Skip to content

Instantly share code, notes, and snippets.

@bkw777
Created March 12, 2023 02:20
Show Gist options
  • Save bkw777/a0de66047e1ce90c9dfb396ef8973f3a to your computer and use it in GitHub Desktop.
Save bkw777/a0de66047e1ce90c9dfb396ef8973f3a to your computer and use it in GitHub Desktop.
Trap & display all possible signals in bash
# with bash-isms
for s in {1..64}; do trap "echo trap $s" $s; done
# without bash-isms
s=1; while [ $s -le 64 ]; do trap "echo trap $s" $s; s=$((s+1)); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment