[Pdx-pm] Who's your Daddy? [was: job control]

Michael R. Wolf MichaelRunningWolf at att.net
Mon Jun 2 00:08:10 CDT 2003

Randall Hansen <perl at sonofhans.net> writes:

> Folks ~
> I'm trying to get a list of bash's suspended jobs using Perl.  

Think about parents. Who's the parent of the job you're querying? What
is the relationship between the PID/PPID of perl(1) and the PID/PPID
of bash(1) which has children that you're trying to query? Remember
that bash and perl will be running in separate processes. I'm assuming
(but could be wrong) that perl is a child of the bash process you're
trying to query. If that assumption is correct, they are all in the
same process group, and you may be in luck. Are you on a Unix-ish
machine. If so, check out process group. It may help you or prevent
you, depending on which side of the dividing line you're on. If not,
I'm not as familiar with the DOS-ish (multi?-)processes.

I've never done something like this, but you may have to creat a hash
of parent/child processes, create a tree, go climbing around, and
query the status of the jobs that are on the right branch.

Then again, I could be barking up the wrong tree, but they are some
ideas that I'd think about if I were stuck.

Michael R. Wolf
    All mammals learn by playing!
        MichaelRunningWolf at att.net

More information about the Pdx-pm-list mailing list