我想在存在脚本之前检查第二个条件的退出代码
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
exit
如果第二个命令的退出状态不为零,我想要脚本。