How to get child process from parent process

AlwaysALearner

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:

cat /path/of/file/to/be/executed

but i'm unable to fetch the pid of the child process.

Miklos Aubert

Just use :

pgrep -P $your_process1_pid

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Using Debugger how to get child process's PID from Parent

From Dev

Using Debugger how to get child process's PID from Parent

From Dev

If you fork() and exec() from the child process, and wait in the parent, how does the parent get a return code from the child?

From Dev

Get child process operation result from parent process

From Dev

Change directory of a parent process from a child process

From Dev

Accessing memory of parent process from child process

From Dev

Webcam stream from parent process to child process

From Dev

Nodejs how to get child process from process Id

From Dev

How to know if a process is a parent or a child

From Dev

Piping from parent parent to child process not working

From Dev

After starting process, how to get parent's PID in the child?

From Dev

How to get the child nodes of a parent and process it with jquery ajax

From Dev

How to get the id of a very short child process if the parent is known?

From Dev

How to get the child nodes of a parent and process it with jquery ajax

From Dev

Process parent ID of child process is different from PID of parent

From Dev

Get child list of parent process in C

From Dev

Send messages from child process to parent

From Dev

send signal from parent process to child in C

From Dev

Piping from parent process to child and back

From Dev

How can child kill parent process while parent process waits until child process to terminate?

From Dev

Pass data from parent process to its child process — IPC, UNIX

From Dev

Child process inherits a handle from its parent process but fails to write in it

From Dev

How to debug child and parent process using windbg?

From Dev

How to wait for parent process to exit in a child?

From Dev

How to let the child process live when parent process exited?

From Dev

How does the fork() know whether it is in child process and in parent process?

From Dev

How to find all child process of a parent process (in C)

From Dev

How does a parent process know the process IDs of the child processes it started?

From Dev

How to discard stdout of child process but keep stdout of parent process?

Related Related

  1. 1

    Using Debugger how to get child process's PID from Parent

  2. 2

    Using Debugger how to get child process's PID from Parent

  3. 3

    If you fork() and exec() from the child process, and wait in the parent, how does the parent get a return code from the child?

  4. 4

    Get child process operation result from parent process

  5. 5

    Change directory of a parent process from a child process

  6. 6

    Accessing memory of parent process from child process

  7. 7

    Webcam stream from parent process to child process

  8. 8

    Nodejs how to get child process from process Id

  9. 9

    How to know if a process is a parent or a child

  10. 10

    Piping from parent parent to child process not working

  11. 11

    After starting process, how to get parent's PID in the child?

  12. 12

    How to get the child nodes of a parent and process it with jquery ajax

  13. 13

    How to get the id of a very short child process if the parent is known?

  14. 14

    How to get the child nodes of a parent and process it with jquery ajax

  15. 15

    Process parent ID of child process is different from PID of parent

  16. 16

    Get child list of parent process in C

  17. 17

    Send messages from child process to parent

  18. 18

    send signal from parent process to child in C

  19. 19

    Piping from parent process to child and back

  20. 20

    How can child kill parent process while parent process waits until child process to terminate?

  21. 21

    Pass data from parent process to its child process — IPC, UNIX

  22. 22

    Child process inherits a handle from its parent process but fails to write in it

  23. 23

    How to debug child and parent process using windbg?

  24. 24

    How to wait for parent process to exit in a child?

  25. 25

    How to let the child process live when parent process exited?

  26. 26

    How does the fork() know whether it is in child process and in parent process?

  27. 27

    How to find all child process of a parent process (in C)

  28. 28

    How does a parent process know the process IDs of the child processes it started?

  29. 29

    How to discard stdout of child process but keep stdout of parent process?

HotTag

Archive