Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: how to get pid for multiple child process in parent process

by thezip (Vicar)
on Jul 01, 2008 at 00:11 UTC ( #694860=note: print w/ replies, xml ) Need Help??


in reply to how to get pid for multiple child process in parent process

You could always do something like:

my $result = qx/pgrep .*/;

This would result in a set of pids for the active shell, one per line. You'll have to investigate to determine the usability of these results. Also, I have only shown the broadest possible result... you'll be able to tweak the arguments to pgrep to fine-tune it.

Here's the current output on my system:

foo@bar ~: pgrep .* 64667 64666 64663 63664 63554 63227 93711 92292 76330 74514 57312 18496 64105 5883 5882 5881 9224 630 623 565

I hope this is helpful.


Your wish is my commandline.


Comment on Re: how to get pid for multiple child process in parent process
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://694860]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (18)
As of 2015-07-30 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls