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
In reply to Re: exec()ed process dont write to std(?:err|out) (system)
by tye
in thread exec()ed process dont write to std(?:err|out)
by demerphq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |