Bash tricks

Posted on 2018-10-03 in Trucs et astuces • Tagged with Bash, Shell, Linux

Sommaire

Scripts

Use this at the top of all your Bash scripts to avoid problems:

# Exit on error.
set -e
# Don't allow undefined variable.
set -u
# Make pipeline fail if any command in it fail.
set -o pipefail