Skip to content

Instantly share code, notes, and snippets.

@quangkeu95
Last active December 6, 2017 03:42
Show Gist options
  • Save quangkeu95/926f9bb413dce12ae85559555f7ff648 to your computer and use it in GitHub Desktop.
Save quangkeu95/926f9bb413dce12ae85559555f7ff648 to your computer and use it in GitHub Desktop.
Linux shell script: set -e and set -x

Set -e and set -x in shell script

set -e:

Enable checking of all commands. The execution of shell script will be aborted if one command returns non-zero status code. Examples:

# true; echo $?
0 

# false; echo $?
1

set -x:

Trace the execution of all commands, it makes the interpreter print each commands in terminal before it is executed. Useful for debugging your shell script.

DEBIAN_FRONTEND="noninteractive"

Turn off debian frontend so no prompt during installation

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