📜  如何通过命令名称杀死循环进程 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:51.948000             🧑  作者: Mango

代码示例1
#!/bin/bash
while :
do
    echo "Press [CTRL+C] to stop.."
    for pid in $(ps -ef | awk '/your_process_name/ {print $2}'); do kill -9 $pid; done  
                                ^keep / /    
    sleep 1
done