Quote:
|
Anyway, I thought of a way to do it...I think. Background the subshell. Have the parent obtain $! and send it into the subshell via a named pipe. Then the parent waits for the subshell to exit.
|
if the subshell that is spawned is sent to the background process group,
there are subtle points to be noted:::
if the subshell is interactive one and if it has to be switched to foreground process group and that must be explicitly done by the parent and it cannot do that by itself; only thing that could be done by the child itself is being stopped by generating SIGTTIN/SIGTTOU
if the subshell is non-interactive, care must be taken that the subshell should not support any of the job control activities.