linux查找某进程id并杀掉

zhongcanw 2020-02-14

#!/bin/sh
tomcat_id=$(ps -ef | grep tomcat | grep -v "grep" | awk ‘{print $2}‘) for tomcatid in $tomcat_id do kill -9 ${tomcatid} echo "killed tomcat_id $tomcatid" done sh /data/4a/tomcat/bin/startup.sh echo "restart tomcat..."

#"--------4a--------"tomcat_id=$(ps -ef | grep tomcat | grep -v "grep" | awk ‘{print $2}‘)for tomcatid in $tomcat_iddo    kill -9 ${tomcatid}        echo "killed tomcat_id $tomcatid"   donesh /data/4a/tomcat/bin/startup.shecho "restart tomcat..." 

相关推荐

WeiHHH / 0评论 2020-03-01