Is it possible to get the child process id from parent process id in shell script?
I have a file to execute using shell script, which leads to a new process process1 (parent process). This process1 has forked another process process2(child process). Using script, I’m able to get the pid of process1 using the command:
but i’m unable to fetch the pid of the child process.
Just use :
pgrep -P $your_process1_pid
Answered By – Miklos Aubert