welcome to dzp's blog!
判断任务是否报错
if [ $? != 0 ]; then exit 1 fi判断是否有用任务在执行
if [ $(ps -ef|grep "xxxxtask"|wc -l) != 1 ]; then echo "There is another [xxxxtask] is running. Exit!" exit 1 fi