ps -ef|grep jenkins.war|grep -v "grep"|awk '{print $2}'
[root@test-server-2 bin]# ps -ef|grep jenkins.war|grep -v "grep"|awk '{print $2}'
22950
#/bin/sh
taskId=`ps -ef|grep jenkins.war|grep -v "grep"|awk '{print $2}'`
echo $taskId
if [ -n "$taskId" ]; then
for id in $taskId
do
kill -9 $id
echo "killed $id"
done
fi
标签2:地址:https://www.leftso.com/article/957.html