文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>两个小脚本一个用于去注释一个用于列出或杀死匹配..

两个小脚本一个用于去注释一个用于列出或杀死匹配..

时间:2006-08-09  来源:coldrainsunc

列出或杀死匹配的程序
#!/bin/sh
#name:lkp
#comment:list or kill processor
if [ $# = "2" ] && [ $2 = "l" -o $2 = "k" ] ; then
{
        if [ -z "$2" -o "$2" = "l" ]; then
                ps aux |grep "$1" |grep -v "grep"|grep -v "/bin/sh"|awk '{print "\t" $1"\t"$2"\t"$11}'
        elif [ "$2" = "k" ]; then
                ps aux |grep "$1" |grep -v "grep"|grep -v "/bin/sh"|awk '{print $2}'|xargs kill
        else
                echo "Useage:$0 processname l|k";
        fi
}
else
{
        echo "usage:
                list the match processor: `basename $0` processor2match l
                kill the match processor: `basename $0` processor2match k"
}
fi

去掉注释:
#!/bin/sh
#name:clcom
#clear the comment
grep -v -e "^#" -e "^  *#" -e "^$" $1
相关阅读 更多 +
排行榜 更多 +
进击的小动物安卓版

进击的小动物安卓版

飞行射击 下载
进攻yalghaar

进攻yalghaar

飞行射击 下载
深空战场

深空战场

飞行射击 下载