I have a bash script that needs to kill a specific PID that can be obtained by:
ps -A | grep -m1 apcagent | awk '{print $1}'
The above code identifies the PID of apcagent... and now I want to kill it within my bash script. Suggestions? Ideas?
I have a bash script that needs to kill a specific PID that can be obtained by:
ps -A | grep -m1 apcagent | awk '{print $1}'
The above code identifies the PID of apcagent... and now I want to kill it within my bash script. Suggestions? Ideas?
Thanks, Benjamin W. for the link. You're right, that question answered mine:
kill $(ps -A | grep -m1 apcagent | awk '{print $1}')
It should be as easy as:
kill -9 <pid>
Did you look at man kill?