首页 » 嵌入式笔记 » 正文 shell 实现监控程运行并自动重启 2019/03/24 | 嵌入式笔记 | justchen | 暂无评论 | 2286 views 使用ps做进程查询 #!/bin/sh while true do procnum=`ps -ef|grep "testApp"|grep -v grep|wc -l` if [ $procnum -eq 0 ]; then /root/testApp & fi sleep 5 done 发表评论 取消 * * Δ