Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 22 Dec 2014, 05:30
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to Kill, to Bash a program to death in Slacko?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Fri 06 Jul 2012, 02:00    Post_subject:  How to Kill, to Bash a program to death in Slacko?  

Trying to open a program in bash script
displaying a file (that works)
and then close or kill the program
(using Puppy Slacko 5.3.3.2)
Is it really so hard?
None of this stuff seems to work . . .

Code:
#/usr/local/bin/defaultdraw draw1 "$@"
inkscapelite draw1 "$@"
sleep 3 "$@"
#killall -9 4438
killall inkscapelite
#kill -s TERM inkscapelite
#pgrep inkscapelite | xargs kill -9
#pkill -f inkscapelite

pkill -f inkscapelite
pkill -9 -f inkscapelite


No programs were killed in the producing of this mail
. . . and that is the problem . . .
Shocked

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
SFR


Joined: 26 Oct 2011
Posts: 1118

PostPosted: Fri 06 Jul 2012, 04:55    Post_subject:  

Hey Lobster

Have you tried: & ?

Code:
#!/bin/sh

inkscapelite draw1 &
sleep 3
killall inkscapelite

Works for me. Cool

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Fri 06 Jul 2012, 07:50    Post_subject:  

and that is all there is to it . . .

Yes it works Cool

Cructacean puts on dunce hat
stands in corner

Appreciate the help Smile

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4426

PostPosted: Mon 16 Jul 2012, 10:48    Post_subject:  

ugg - please only use killall as a last resort

program args &
programpid=$!
... do stuff ...
kill $programpid

... and that way you won't piss off your users because you killed their other opened instance of <program> that had weeks of unsaved data opened ... in other words, don't use a machete when the right tool is a scalpel

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0449s ][ Queries: 11 (0.0037s) ][ GZIP on ]