判断pid是否存在的小脚本

1469阅读 0评论2012-12-13 Jejory
分类:Python/Ruby


点击(此处)折叠或打开

  1. #bin/bash
  2. pid=$1
  3. ps aux | awk '{print $2}' | grep $pid | grep -q -v grep
  4. if [ $? -eq 0 ] ;then
  5. echo "exist"
  6. else
  7. echo "not exst"
  8. fi



上一篇:清空Oracle临时表空间操作
下一篇:oracle表数据恢复操作