一个判断进程是否存在的shell
时间:2009-03-23 来源:sjhf
test.sh
#!/bin/bash pid=`ps aux|grep -v grep|grep -v "test.sh"|grep $1|sed -n '1P' | awk '{print $2}'` if [ -z $pid ] ;then echo "there isn't this process!" else echo $pid fi |
相关阅读 更多 +