shell获取nginx工做进程数量和进程号

#!/bin/sh worker_num=`ps -ef|grep nginx|grep worker|wc -l`; echo $worker_num worker_id=`ps -ef|grep nginx|grep worker|awk '{print $2}'`  for id in $worker_id do echo $id done
相关文章
相关标签/搜索