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
I'v written a scrpit to get all child process pids of a parent process. Here is the code.Hope it helps.
function getcpid() { cpids=`pgrep -P $1|xargs` # echo "cpids=$cpids" for cpid in $cpids; do echo "$cpid" getcpid $cpid done } getcpid $1