-1

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?

David Allie
  • 127
  • 2

2 Answers2

-1

Thanks, Benjamin W. for the link. You're right, that question answered mine:

kill $(ps -A | grep -m1 apcagent | awk '{print $1}')

phoxis
  • 60,131
  • 14
  • 81
  • 117
David Allie
  • 127
  • 2
-1

It should be as easy as:

kill -9 <pid>

Did you look at man kill?

Tamias
  • 173
  • 9