3
0

usage.tests 391 B

1234567891011121314151617181920212223242526272829303132333435
  1. # no output -- default state
  2. echo ___
  3. trap
  4. # assign some traps
  5. echo ___
  6. trap "a" EXIT INT USR1 USR2
  7. # show them all
  8. echo ___
  9. trap
  10. # show them by command substitution
  11. echo ___
  12. echo $(trap)
  13. # show them by pipe
  14. echo ___
  15. trap | cat
  16. # show them by process substitution
  17. echo ___
  18. cat <(trap)
  19. # clear one
  20. echo ___
  21. trap 0 INT
  22. echo ___
  23. trap
  24. # clear another
  25. echo ___
  26. trap "-" USR1
  27. echo ___
  28. trap