shell脚本循环判断进程是否存在

时间:2023-02-05 16:20:07
#!/bin/sh
02   
03 while true
04 do
05         process=`ps aux | grep mysqld | grep -v grep`;
06   
07         if "$process" == "" ]; then
08                 sleep 1;
09                 echo "no process";
10         else
11                 echo "process exsits";
12                 break;
13         fi
14 done