bash 循环检测 进程

xcompmgr 太不稳定了 就写了个脚本

#!/bin/bash 
while [ 1 ]
do 
  PIDS=`ps -ef |grep xcompmgr |grep -v grep | awk '{print $2}'`
  if [ "$PIDS" != "" ]; then 
    #echo "It's running" 
    sleep 5
    continue 
  else 
     xcompmgr -Ss -n -Cc -fF -I-10 -O-10 -D1 -t-3 -l-4 -r4 & 
  fi 
done