Skip to content

Instantly share code, notes, and snippets.

@sean9999 sean9999/strict_mode.sh
Last active Sep 19, 2019

Embed
What would you like to do?
#strict #mode for the #bash #shell
#!/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
You can’t perform that action at this time.