loops - While process is not running, do something -
while ps aux | grep '[/]pathtoprocess' echo running done echo process finished
i use shell script keep running while process running. same while process not running.
how go it? in advance
x=$(ps aux | grep '[/]pathtoprocess') while false echo not running done
==========================================================================
new script
#!/bin/ksh if ps -aux | grep "[/]$1" echo "running" else echo "not running" #do stuff # can add while loop here #echo "process finished fi
output:
./icheck.sh xyz not running ./icheck.sh usr/bin/cron running
Comments
Post a Comment