fork download
  1. #!/bin/bash
  2. on_die()
  3. {
  4. echo "Dying...\t PID: $$"
  5. exit 0
  6. }
  7.  
  8. fun(){
  9. trap 'on_die' TERM
  10. echo "Sleeping"
  11. sleep 10
  12. echo "Exiting... PID: $$"
  13. }
  14.  
  15. fun
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout

Standard output is empty