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
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"