in reply to wait syntax for background process to complete

while (wait > -1) {};
If you know you only can have one child process, you could just use:
wait;