status, msg = commands.getstatusoutput("ps -ef | grep start.sh | grep -Fv grep | awk '{print $10}'")

查找含有start.sh的进程,并过滤掉grep命令的行,然后输出第10列数据

status:执行状态,0代表没找到

msg:命令的执行结果,msg.find("start.sh")  -1代表没匹配到,>-1代表匹配到了

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-12-12
  • 2022-01-23
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-07-24
相关资源
相似解决方案