morrin has asked for the wisdom of the Perl Monks concerning the following question:
And I have a signal handler that reaps the child and does a check for $? to get the status. However as expected, it returns the exit status of "com2". Is there any way to do what I want to do? I've tried looking at some other message boards and I think people get around it by playing around with named pipes and echoing each individual exit status back to the shell. What I want is to have the child process return the status of "com1" back to the parent. Is this possible? I'm sure it is possible but is there an elegant solution to it? Thanks in advance for any reply.if (fork()){ } else { exec "com1 | com2"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning status to parent from pipe
by ikegami (Patriarch) on Aug 25, 2010 at 20:34 UTC | |
by morrin (Acolyte) on Aug 25, 2010 at 21:22 UTC | |
|
Re: Returning status to parent from pipe
by Crackers2 (Parson) on Aug 25, 2010 at 20:53 UTC | |
by morrin (Acolyte) on Aug 25, 2010 at 21:11 UTC | |
by ikegami (Patriarch) on Aug 25, 2010 at 23:01 UTC |