Automatically find the keyword pid to kill the process script


#!/bin/sh

pid=`ps -ef | grep "Keywords" | grep -v "grep" | awk'{print $2}'`
echo $pid

for id in $pid
do
    kill -9 $id
    echo "killed $id"
done

 

Guess you like

Origin blog.csdn.net/xlyrh/article/details/103688992