bash script, monitoring running PID?
I need a script that starts a program (easy) then monitors that program and if it errors, or closes issues a shutdown now -h command.
first and last parts are easy. its the srcipt to monitor the running PID that i can't figure out!!! |
Hi,
use the shell builtin 'wait' for this task, e.g. Code:
myprog & bruce |
what is the purpose of the &?????
|
To run the program in the background, so the script will continue while the program is running. In this case running the program in the background is really needed, because you want the wait command in the script to execute so it will do the monitoring you want.
|
it works thanks guys!!
|
All times are GMT -5. The time now is 10:40 AM. |