Find the PID(s) of running processes and store as an array

前端 未结 4 1452
被撕碎了的回忆
被撕碎了的回忆 2021-01-12 03:01

I\'m trying to write a bash script to find the PID of a running process then issue a kill command. I have it partially working, but the issue I face is that there may be mor

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-12 03:34

    Your script seems fine, if you want to have each pid list on a new like then replace:

    echo $pid
    #kill $pid
    

    with

    echo "$pid"
    #kill "$pid"
    

提交回复
热议问题