The code I have does not wait. My assumption is that getting the parent of 1 means that I am getting a child without the overhead of the parent.
Code is Below
edit (broquaint): changed <pre> <code> tags# Fork the process as its own parent. I am assuming by # recieving a parent of 1 that the Child is not just a copy # of the parent. unless (fork) { # Create first child unless (fork) { # Create Second Child sleep 1 until getppid == 1; # Execute our command exec "distill mypsfile.ps"; exit 0; } exit 0; } # Wait for the first child to be reaped # How can we make this wait until the exec statement # has completed before exiting ????????? wait;
In reply to Creating Child without overhead of Parent by cxbast
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |