I'm using timeout core utility in my bash shell script. The problem I'm facing is I want the PID of the command which is supplied to timeout. Let me explain with the code I'm using:
timeout 120 ./prog1 &
the above script gives me PID of timeout process but not of the prog1, so how do I get that.
What I observed is: prog1 PID = timeout PID + 1
Is it always the case that if I add 1 to timeout PID, I get prog1 PID ?