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 01 Sep 2014, 17:15
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 [4 Posts]  
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
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 poster's website 
SFR


Joined: 26 Oct 2011
Posts: 1063

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: 15117
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 poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4348

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 from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0635s ][ Queries: 12 (0.0190s) ][ GZIP on ]