Re: killing a large lists of pids



On Nov 29, 8:54 am, K-mart Cashier <cdal...@xxxxxxxxx> wrote:
Say I have the following list of pids...
8, 2, 5, 4, 3, 9, 7, 11

I've seen some code where people would sort the pids before killing
them. What is the possible advantage of this? If you already have the
list of pids, couldn't you just traverse the list, killing each one
along the way?

Chad

for pid in "8 2 5 4 3 9 7 11"
do
kill $pid
done

.



Relevant Pages

  • Re: killing a large lists of pids
    ... I've seen some code where people would sort the pids before killing ... But there's no functional reason that ...
    (comp.unix.programmer)
  • Re: killing a large lists of pids
    ... I've seen some code where people would sort the pids before killing ... I think the only reason to sort would be for "neatness", ...
    (comp.unix.programmer)
  • Re: killing a large lists of pids
    ... I've seen some code where people would sort the pids before killing ... Guess the reason is that typically the parent processes have lower PIDs and ...
    (comp.unix.programmer)
  • Re: nbc What a spoiled kid owes John McCain nbc
    ... I'm not disputing Ms. Graduate's take on the war, ... I don't expect her to understand that sort of commitment. ... killing he declined to do so in favor of wanting to go out and kill more. ...
    (rec.music.artists.springsteen)
  • Re: How to get filename of an open file descriptor
    ... the opinion that psis overburdened as tools go, and that the goals are actually somehwat different--procstatintentionally doesn't have the ability to generate a list of processes, for example, taking pids explicitly as the argument; likewise, historically pshas not been interested in printing more than one line per process. ... and I sort of knew that from the beginning which is why I didn't provide feedback immediately. ... While procstatcurrently takes a list of pids, I wouldn't be surprised if somebody adds code to list all processes, unless you block it. ... I think I prefer bundling it into a single tool, but it's certainly a similar idea. ...
    (freebsd-hackers)