in reply to exec()ed process dont write to std(?:err|out)
the first perl immediately exits
Yes, exec ends the life of the executable that calls it, as documented. On systems that don't have fork, a call to exec spawns a subprocess and then tells the parent process to exit. If you want the grandparent (the process that started the process that ends up calling exec) to wait for the exec'd program to finish, then you need to have the middle process hang around.
On systems with fork, using exec works for that since the running executable is replaced with the new executable in the same process. On systems without fork, if you want to wait, then you should just use system then exit.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: exec()ed process dont write to std(?:err|out) (system)
by demerphq (Chancellor) on Apr 13, 2004 at 15:06 UTC | |
by tye (Sage) on Apr 13, 2004 at 15:30 UTC | |
by demerphq (Chancellor) on Apr 13, 2004 at 15:42 UTC | |
by tye (Sage) on Apr 13, 2004 at 16:00 UTC | |
by demerphq (Chancellor) on Apr 13, 2004 at 16:07 UTC | |
|