killing PIDs from a file

Thread Solved

Join Date: Apr 2008
Posts: 88
Reputation: Trekker182 is an unknown quantity at this point 
Solved Threads: 0
Trekker182 Trekker182 is offline Offline
Junior Poster in Training

killing PIDs from a file

 
0
  #1
Nov 14th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,039
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: killing PIDs from a file

 
0
  #2
Nov 15th, 2008
awk '{ system("kill " $2) }'
Last edited by Rashakil Fol; Nov 15th, 2008 at 11:07 pm.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 88
Reputation: Trekker182 is an unknown quantity at this point 
Solved Threads: 0
Trekker182 Trekker182 is offline Offline
Junior Poster in Training

Re: killing PIDs from a file

 
0
  #3
Nov 16th, 2008
Thanks! That did it...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Legacy and Other Languages Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC