What is the best way to kill a number of PIDs that I've isolated from an external file?

So far I've done grep PID badPids | awk {'print$2}'

to get the list of bad PIDS to kill. I've searched through the man pages to no avail and I need to be able to do it from the terminal line, not a script file.

I know that kill -k will do it, but I'm not sure on how to pass the list to kill.

Thanks.

Recommended Answers

All 2 Replies

awk '{ system("kill " $2) }'

Thanks! That did it...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.