I want to check process status at regular interval of time ...
so i ha wirtten this BUT its not working when i placed this peace of code in .sh ..
please help me out
#!/bin/sh
w = ps -ef|grep processname | wc - l
echo $w
if [ $w -lt 3 ] ; then
Banner "Proceesname Problem"
else
Banner " Running Fine"
fi
Please help me out with necessary modification .
Thanks in advance...
hi jim,
Thank you very much,
I got the solution and the problem is when we are trying taking variable "w" it is giving some errors i think "w" is internal system parameter .
I tried it with taking "t" as variable it got executed.
Thank you once again for helping me out JIM.
Lastly i have one dought "ps -ef|grep $processname | grep-v 'grep' | wc - l"
why did you grep -v 'grep' i havent used like this any time.
grep -v 'grep' would tend to filter the process output, not to include grep process.. Remember that it may be included as a process, and would confusions. So to be safe, that was added...