in reply to How to catch that pid?

Well, the usual way is to use fork, which will give you the PID, and then an exec in the child. In fact, assuming a Unix or Unix like platform, this will be happening being the scenes regardless how to start a different process.