test09.sh 257 B

123456789101112131415
  1. #!./testshell
  2. trap 'echo I am a trap' 2
  3. echo 'Try to break wait using SIGINT before wc completes'
  4. echo 'After you break wait, it should print "I am a trap"'
  5. echo 'and then "Going on"'
  6. echo 'wc &'
  7. wc /dev/zero &
  8. p=$!
  9. echo wait
  10. wait
  11. echo "Going on"
  12. kill $p