程序单例执行

info_ps=`ps -ef|grep $xxxxx |grep -v grep| grep -v '^$'`
n=`echo -n $info_ps|wc -l`
if [ ! $n -lt 1 ] #如果已经运行
then 
fi

原文地址:https://www.cnblogs.com/liyulong1982/p/2445231.html