Last active
September 19, 2019 16:21
-
-
Save sean9999/4ad013c12752d15d2d58b8e4c4cc746a to your computer and use it in GitHub Desktop.
#strict #mode for the #bash #shell
This file contains 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
#!/bin/bash | |
# @credit :: http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
## -e :: instructs bash to immediately exit if any command has a non-zero exit status. | |
## -u :: a reference to any variable you haven't previously defined is an error, and causes the program to immediately exit | |
## -o pipefail :: If any command in a pipeline fails, that return code will be used as the return code of the whole pipeline | |
## IFS :: IFS stands for Internal Field Separator - controls what Bash calls word splitting | |
set -euo pipefail | |
IFS=$'\n\t' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment