0

スクリプトが存在する前に、2 番目の条件の終了コードを確認したい

if [ -f "/var/lock/myproc/agentlock" ] && \
   [ $(ps ax | grep "myproc" | grep -v "grep" | awk '{print $1}' | xargs kill -9) ]; then

 echo "Exiting without running the rest of the script" | sendmail $myemail
 exit

fi

exit2 番目のコマンドの終了ステータスがゼロ以外の場合にスクリプトを実行したい。

4

1 に答える 1