Shell脚本执行donot退出

时间:2013-02-13 11:38:53

标签: shell

当我以root用户身份执行shell脚本时,它执行得很完美但是当我以普通用户(而不是root用户)执行shell脚本时,shell脚本会连续执行。 root用户或普通用户是否确定shell脚本的执行?

#!/bin/sh

s=$1      

pro=`ps -ef | grep $s | grep -v grep | grep -v test3.sh | wc -l`

if [ $pro -eq 0 ] 
then
        echo "Service $s is DOWN..."
        echo "Service $s is DOWN..." >> processlogs.txt
        echo "Starting Service $s..."
        echo "Starting Service $s..." >> processlogs.txt
        java -jar clientApplication.jar $s &

else
        echo "Service $s is Running..."
        echo "Service $s is Running..." >> processlogs.txt

fi

0 个答案:

没有答案