#!/bin/sh
pid=`ps -ef|grep 'renren' |grep -v grep|awk '{print $2}'`
echo '结束进程'
echo $pid
kill $pid
sleep 5s
echo '启动接口'
nohup java -jar renren-api.jar >nohup.out 2>&1 &
tail -f nohup.out
#!/bin/sh
pid=`ps -ef|grep 'renren' |grep -v grep|awk '{print $2}'`
echo '结束进程'
echo $pid
kill $pid
sleep 5s
echo '启动接口'
nohup java -jar renren-api.jar >nohup.out 2>&1 &
tail -f nohup.out
本文标题:Linux获取pid
本文链接:https://www.haomeiwen.com/subject/jjzbaqtx.html
网友评论