Skip to content

Instantly share code, notes, and snippets.

Joshua Fox coffeejoshua

View GitHub Profile
View gist:439637f3261d729d061915d9503407fd
#!/usr/bin/env bash
# bash exit cleanup snippet
# By default, the shell will continue on errors (sometimes to your detriment)
# To learn about exit status, visit http://tldp.org/LDP/abs/html/exit-status.html
# To learn about the set builtin, visit https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# To learn about traps, visit http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_12_02.html
# We use set -e to exit immediately if a command exits with a non-zero status.
You can’t perform that action at this time.