Guest User

Untitled

a guest
Jan 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. echo $$
  2. do_fork()
  3. echo $$
  4.  
  5. <ProcessA PID>
  6. <ProcessB PID>
  7. <ProcessA PID>
  8.  
  9. <ProcessA PID>
  10. <ProcessA PID>
  11. <ProcessB PID>
  12.  
  13. echo child & echo parent
  14.  
  15. first(); fork(); second(); third();
  16.  
  17. after_fork () { second; third; }
  18. first; after_fork & after_fork
  19.  
  20. first(); if (fork()) parent(); else child();
  21.  
  22. #!/bin/bash
  23.  
  24. (sleep 2; echo "subsh 1")&
  25. echo "topsh"
Add Comment
Please, Sign In to add comment