Skip to content

Instantly share code, notes, and snippets.

@jimathyp
Created June 13, 2021 04:09
Show Gist options
  • Select an option

  • Save jimathyp/b0069bc2d21fe87ef91bd8e37bcf5b59 to your computer and use it in GitHub Desktop.

Select an option

Save jimathyp/b0069bc2d21fe87ef91bd8e37bcf5b59 to your computer and use it in GitHub Desktop.

bash options

https://tldp.org/LDP/abs/html/options.html#:~:text=The%20set%20command%20enables%20options,Echoes%20all%20commands%20before%20executing.

shopts

set ...

-e errexit Abort script at first error, when a command exits with non-zero status (except in until or while loops, if-tests, list constructs)

-o Option-Name (none) Invoke the Option-Name option -u nounset Attempt to use undefined variable outputs error message, and forces an exit -v verbose Print each command to stdout before executing it -x xtrace Similar to -v, but expands commands -C noclobber Prevent overwriting of files by redirection (may be overridden by >|)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment