我有一个这样的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
当我执行 shell 脚本时,操作进入 if 条件,它永远不会回来。它连续执行命令“java -jar clientApplication.jar $s”。但是在其他条件下没有问题。我的语法错误还是任何逻辑错误。
谢谢 ...