Created
March 12, 2023 02:20
-
-
Save bkw777/a0de66047e1ce90c9dfb396ef8973f3a to your computer and use it in GitHub Desktop.
Trap & display all possible signals in bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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