in reply to Re: Doing a system command and getting the pid
in thread Doing a system command and getting the pid
I think you've got your if backwards. fork returns zero to the child, and gives the parent the child's pid, so you want to do your exec in the case that $child is 0 (but defined).