美文网首页
liunx 根据进程名关闭程序脚本

liunx 根据进程名关闭程序脚本

作者: 刹那的既视感 | 来源:发表于2019-06-10 11:11 被阅读0次

!/bin/bash

author: wmy

time: 2019年6月10日10:19:50

description:列出将要关闭的程序,提示用户是否关闭

if [ -n "1" ]; then ps -ef|grep1
echo -n "是否关闭以上进程:yes/no "
read input
if [ "input" == 'yes' ]; then ps -ef|grep1 |grep -v grep|awk '{print $2}'|xargs kill -9
else
echo "exit"
fi
else
echo '################################'
echo ''
echo '请输入想关闭的进程中包含的字符串'
echo ''
echo '################################'
fi

相关文章

网友评论

      本文标题:liunx 根据进程名关闭程序脚本

      本文链接:https://www.haomeiwen.com/subject/aawaxctx.html