参考文章:https://www.cnblogs.com/taiguyiba/p/7487258.html tomcat 重启shell #!/bin/sh #kill and restart tomcat name=tomcat pidlist=`ps -ef | grep $name | grep -v "grep" | awk '{print $2}'` function stop