How to Kill, to Bash a program to death in Slacko?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

How to Kill, to Bash a program to death in Slacko?

#1 Post by Lobster »

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: Select all

#/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 . . .
:shock:
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

Hey Lobster

Have you tried: & ?

Code: Select all

#!/bin/sh

inkscapelite draw1 &
sleep 3
killall inkscapelite
Works for me. 8)

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

and that is all there is to it . . .

Yes it works 8)

Cructacean puts on dunce hat
stands in corner

Appreciate the help :)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#4 Post by technosaurus »

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
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply