当前位置: 技术问答>linux和unix
求一个启动程序的脚本!
来源: 互联网 发布时间:2015-11-15
本文导语: #!/bin/sh if ps -ef|grep 'type'|grep -v grep;then echo "successful" else cd /opt/sj nohup ./type >/dev/null & fi //******************************************* #!/bin/sh st=ccr0 sr=grep isrun='ps -ef|grep ${st}|grep -v ${sr}' if [ -z $isrun ] then echo "start prog...
#!/bin/sh
if ps -ef|grep 'type'|grep -v grep;then
echo "successful"
else
cd /opt/sj
nohup ./type >/dev/null &
fi
//*******************************************
#!/bin/sh
st=ccr0
sr=grep
isrun='ps -ef|grep ${st}|grep -v ${sr}'
if [ -z $isrun ]
then
echo "start program!"
cd /opt/sj
nohup ./type >/dev/null &
else
echo "no strart!"
fi
上面两端脚本有问题吗?指教!thanks
if ps -ef|grep 'type'|grep -v grep;then
echo "successful"
else
cd /opt/sj
nohup ./type >/dev/null &
fi
//*******************************************
#!/bin/sh
st=ccr0
sr=grep
isrun='ps -ef|grep ${st}|grep -v ${sr}'
if [ -z $isrun ]
then
echo "start program!"
cd /opt/sj
nohup ./type >/dev/null &
else
echo "no strart!"
fi
上面两端脚本有问题吗?指教!thanks
|
碰到什么问题?