shell script question

Jeremy C. Reed reed at reedmedia.net
Mon Jul 31 14:43:03 MST 2006


On Mon, 31 Jul 2006, David wrote:

> pid=`/bin/ps -e | grep process_name | grep -v mon | grep -v grep | sed 
> -e 's/^ *//' -e 's/ .*//' | head -1`

There is a possibility that the return is empty (so the variable named 
"pid" does not have a value).

>     if [ "X$pid" != "X" ]

So check here.


More information about the PLUG-discuss mailing list