Results 1 to 5 of 5
I just have a couple questions on how to accomplish what I'm trying to do, both in Bash and in Perl.
I would like to know how to specify the ...
- 05-28-2009 #1
Questions about Bash/Perl signals/process names
I just have a couple questions on how to accomplish what I'm trying to do, both in Bash and in Perl.
- I would like to know how to specify the process name (that would be used by killall) of the script.
- I would like to know what command I could put in the script to effectively "pause" it, and also what signal I would need to pass to the script to have it "resume" from the pausing command.
I'm trying to accomplish both things with Bash and both things with Perl.
- 05-29-2009 #2Just Joined!
- Join Date
- Dec 2006
- Posts
- 85
well i dont know much about perl, but for for killall its pretty simple just killall <mane of process>
for instance say im running a program called foo.bar i would say killall foo.bar
if i wanted to send a certain signal (say SIGINT) i would use killall -s INT foo.bar
killall can also kill a bunch of processes, so say i have foo.bar foo.this foo.that. and foo.theotherthing i can say kill foo, and kill all those foos.
to stop one simply send it SIGSTOP and resume is SIGCONT
hope that helps
- 05-29-2009 #3
- 05-29-2009 #4Just Joined!
- Join Date
- Dec 2006
- Posts
- 85
the name of the process is the name of the application you ran.
so suppose i compile a program foo.cpp into an executable foo.bar, i run foo.bar, now if i killall foo.bar..that executable is killed.
if you made test.sh and ran it, you can kill it with killall test.sh
and yes, it can stop itself (though...you coulda just made a shell like i did in a couple seconds and tested that yourself.)
- 05-29-2009 #5
Ah, I get it; thanks! So, I just name the script whatever I want to be used by killall, and then for script test.sh, I would add a line in it like "killall -s SIGSTOP test.sh", and then I can resume it from another script by "killall -s SIGCONT test.sh". I think I understand this now. Thanks!


Reply With Quote
