in reply to Re: Re: Getting PIDs
in thread Getting PID's

I'm not convinced that you'll be able to get the PID of the command which is being exec()'d.

exec() doesn't change the process id.