in reply to waiting on a process group

The unix documentation I have read says you can call waitpid with a negitive pid to wait on an entire process group.

My documentation says something slightly different, it says that a negative pid waits on a child process in the process group, not an entire process group just your children. You should be able to wait on your children with -$pid but not your grandchildren.