#!/bin/sh
#written by ccj copyleft@ccj
while getopts :s:h OPTION
do
case ${OPTION} in
s) STR=${OPTARG}
kill -9 `ps -ef |grep $STR |awk '{print $2}' `;;
h) echo "usage:./k -s string";;
esac
done
shift $(($OPTIND-1))
exit 0
使用方法,杀掉ps -ef|grep opt的所有进程 ./k -s opt
阅读(1332) | 评论(2) | 转发(0) |