Hi,

ksh version:   sh (AT&T Research) 93t+ 2009-05-01
OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

I am doing some work that requires tracking background jobs in a shell.
I earlier versions of ksh the command "jobs -ln" would print out the process
id(s) of the job(s) that had ended, so I would parse the output
and in a for loop to pass the process id(s) to wait, to check the exit
status.

But in this release I have found that "jobs -ln" does not include the
process id.

Cut down example of what I mean:

set -o monitor

trap checkbg CHLD

function checkbg
{

    jobs -ln
}

sleep 10 &

wait

exit 0

This prints out;
"[1] +  Done                    <command unknown>"

Is this correct or is there something else I have to do to get the process
id from the jobs command?

Is there a better way to check the exist status from a bunch of background
jobs in a script?

Thanks

Pete
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to