#!/bin/sh
#写法一
#该语句表面列出所有有tomcat进程的编号,但只输出pid列,同时得第8列不包含grep自身进程号,然后将值输入给tpid,供下面kill
ps-ef|greptomcat|awk'{if($8!~/grep/)print$2}'|whilereadtpid
do
kill-9$tpid
done
#写法二
tpid=$(ps-ef|greptomcat|awk'{if($8!~/grep/)print$2}')
kill-9$tpid
#!/bin/sh
#写法一
#该语句表面列出所有有tomcat进程的编号,但只输出pid列,同时得第8列不包含grep自身进程号,然后将值输入给tpid,供下面kill
ps-ef|greptomcat|awk'{if($8!~/grep/)print$2}'|whilereadtpid
do
kill-9$tpid
done
#写法二
tpid=$(ps-ef|greptomcat|awk'{if($8!~/grep/)print$2}')
kill-9$tpid
进程间通信方式,命名管道,共享内存。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M