我有一个这样的shell脚本。
#!/bin/sh
s=$1
pro=`ps -ef | grep $s | grep -v grep | grep -v test3.sh`
pro1=`ps -ef | grep $s | grep -v grep | grep -v test3.sh | wc -l`
echo $pro
echo $pro1
if [ $pro1 -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" &
exit 0
else
echo "Service $s is Running..."
echo "Service $s is Running..." >> processlogs.txt
fi
现在我想将 $s 的值传递给 java 程序。我应该为此做些什么。谢谢。