calinserban
Programmer
I'm not a shell script programmer, so the question it might look like one for a first student grade.
I have been asked 2 days ago to write an AIX script to start up or shut down some specific processes at one time. Everything looks OK, excepting that I want to make sure that in case the "start up" option is chosen, those specific processes are not running. To be more specific, I will take only one process, say "omni". I declared a variable
OMNI_PID=$(ps -eaf | grep omni | grep -v grep | awk '{print substr($2,1,20);}'), and I want to test if that process is running, but I don't know what it returns if the service is not running:
if [ $OMNI_PID != null ]
then
echo " The OMNI services are running in the system."
else
echo " Starting RMI services"
nohup omniNames &
fi
When the process is running, I'm getting a 5 digits number, but when not, I don't have a clue what I should put in the if statement.
Any help would be appreciated.
Thanks