Linux Shell脚本实现根据进程名杀死进程
#!/bin/sh#根据进程名杀死进程if [ $# -lt 1 ]then echo "缺少参数:procedure_name" exit 1fi PROCESS=`ps -ef|grep $1|grep -v grep|grep -v PPID|awk '{ print $2}'`for i in $PROCESSdo echo "Kill the $1 process [ $i ]" kill -9 $idone
赞 (0)
#!/bin/sh#根据进程名杀死进程if [ $# -lt 1 ]then echo "缺少参数:procedure_name" exit 1fi PROCESS=`ps -ef|grep $1|grep -v grep|grep -v PPID|awk '{ print $2}'`for i in $PROCESSdo echo "Kill the $1 process [ $i ]" kill -9 $idone