【发布时间】:2017-03-31 20:54:12
【问题描述】:
我运行一个 bash 脚本,使用该脚本启动一个在后台运行的 python 脚本
#!/bin/bash
python test.py &
那么我怎样才能用 bash 脚本杀死脚本呢?
我用下面的命令杀死但输出no process found
killall $(ps aux | grep test.py | grep -v grep | awk '{ print $1 }')
我尝试通过ps aux | less检查正在运行的进程,发现运行脚本有python test.py的命令
请帮忙,谢谢!
【问题讨论】:
-
你在
ps的进程信息中找到关键字“test.py”了吗?
标签: python linux bash raspberry-pi3