如果某个进程 (PID) 仍在运行,我如何检查脚本?
\ne.g.\ncheck if PID still running\nif yes then keep checking\nif not then echo PID has finished and send simple email\n\nor \nCheck if PID is not running\necho PID not running and send simple email\nelse\ngo back and check again\nRun Code Online (Sandbox Code Playgroud)\n附加信息:\nMail 将是一个简单的命令,当 PID 消失时执行,例如mail -s "PID update" abc@gmail.com <<< "PID $pid has exited on $HOSTENAME on $(date)" \xe2\x80\x93
附加信息:PID 将活跃几天,因此监控脚本必须在后台继续检查很长时间
\n