test13.sh 245 B

12345678910
  1. #!./testshell
  2. echo 'Test 13 (variant of Test 1):'
  3. echo 'On SIGINT, cat should exit (and be restarted by the shell loop)'
  4. echo 'and the Text "I am a trap" should be printed'
  5. set -x
  6. trap 'echo I am a trap' 2
  7. while : ; do cat ; echo -n $? ; done