このようなシェルスクリプトがあります。
#!/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
シェル スクリプトを実行すると、操作が if 条件に入ると、元に戻りません。コマンド「java -jar clientApplication.jar $s」を継続的に実行します。ただし、else 条件では問題ありません。私の構文が間違っているか、論理エラーですか。
ありがとう ...