Started programs with one script. Want to kill them with another
I started several programs with the following script:
Code:
front_end1 input1_a & |
killall
You can kill programs by name as well as by pids. See man killall.
|
You can also use the following:
kill `ps aux | grep PROGRAM | awk "${2}"` Most likely, I jacked up the quotation marks because I am at work and am using a *gag* windows machine.....so just fix the awk command up and there you go! |
Assuming that you're using bash, you're looking for the "jobs" builtin command. For instance:
Code:
#!/bin/bash When using the '-l' option, the PID is displayed in the second column (hence the awk command). You can then save the PIDs to a file. Your other script can read the PIDs from that file, kill the PIDs listed, and then delete the PID file. |
All times are GMT -5. The time now is 04:33 PM. |