943,682 Members | Top Members by Rank

Ad:
Nov 14th, 2008
0

killing PIDs from a file

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Trekker182 is offline Offline
93 posts
since Apr 2008
Nov 15th, 2008
2

Re: killing PIDs from a file

awk '{ system("kill " $2) }'
Last edited by Rashakil Fol; Nov 15th, 2008 at 11:07 pm.
Team Colleague
Reputation Points: 1133
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005
Nov 16th, 2008
0

Re: killing PIDs from a file

Thanks! That did it...
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Trekker182 is offline Offline
93 posts
since Apr 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: ASP , ASP .NET , CLR , Runtime.
Next Thread in Legacy and Other Languages Forum Timeline: NATURAL data types





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC