Quote:
|
Originally Posted by LwdSquashman Is that the whole walk.sh. script? I would assume you need to close the IF statement. But I do not know if scripting in KSH is different from Bash. I have never used KSH.
if
fi |
Thanks a for fast response,
I closed the script with fi but I missed this while pasting this script into this thread , I don't think there will be much difference between ksh and bash with regard to below logic.
#!/bin/ksh
sleeppid=`ps -aef | grep -i "sleep.sh" | grep -v grep | awk '{print $2}'`
standpid=`ps -aef | grep -i "stand.sh" | grep -v grep | awk '{print $2}'`
if [ ${sleeppid} -gt 1 ] || [ ${standpid} -gt 1 ]
then
echo "sleep or stand process already started"
exit
else
echo "walk process can be started"
sleep 120
fi