shell script question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: David
Date:  
To: plug-discuss
Subject: shell script question

What is the point of the below in a script? This snippage is in the
'stop' portion of an init script. I just dont see the point of the if
statement. It almost looks like it's just making sure $pid isn't empty.


------begin snippet------

pid=`/bin/ps -e | grep process_name | grep -v mon | grep -v grep | 
sed -e 's/^  *//' -e 's/ .*//' | head -1`
     if [ "X$pid" != "X" ]
     then
             /bin/kill $pid
             echo "**process_name** interface stopped"
     fi
------end snippet------


Thanks,
David

--
"I find your lack of faith disturbing."
--Darth Vader
---
14:32:01 up 9 days, 47 min, 1 user, load average: 0.00, 0.00, 0.00
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss