检查进程存在的简单脚本供参考 #!/bin/bash MAIN_NAME="pcie" RESULT="" ZERO=0 while true do RESULT=$(ps | grep pcie| grep -v grep) if [ ${#RESULT} == ${ZERO} ]; then echo mainProgressExit dmesg > /log/dmesg.log & exit fi sleep 3 done