Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10504112
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-03-23 11:09:34

test.sh 
#!/bin/bash
        pid=`ps aux|grep -v grep|grep -v "test.sh"|grep $1|sed -n '1P' | awk '{print $2}'`
        if   [ -z $pid ]   ;then
                echo   "there   isn't   this   process!"
  else
                        echo $pid
        fi
阅读(1544) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~