The exit status of ps is stored in $?. Make the following statement an if statement to check $? for the grep exit status. My guess is that a zero exit status means that prog_name is running and a non zero exit status means that prog_name is not running, but you may have to figure that out by trial and error.
Last edited by jailbait; 07-27-2003 at 03:09 PM.
|