check if a linux process is done using bash

时间:2014-07-28 15:06:23   收藏:0   阅读:293

# cat > check_process_is_end.sh


while true
do
   sleep 30
   res=`ps -ef | grep RNAhybrid`
   count=`grep -o "RNAhybrid" <<<"$res" | wc -l`
   if [ "$count" -eq "1" ] ; then
        echo $res
        echo -en "\007"
        sleep 1        
        echo -en "\007"  
        sleep 1        
        echo -en "\007"  
   fi
done


# chmod u+x check_process_is_end.sh
# ./check_process_is_end.sh

 

NOTE: RNAhybrid is a process name.
 

check if a linux process is done using bash,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!