Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 382 Bytes

002-bash-strict-mode.md

File metadata and controls

15 lines (12 loc) · 382 Bytes

Save yourself a lot of hassle when writing shell scripts by adding the following to the top of the file:

#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
-e: stop if a command fails
-u: error on undefined variable
-o pipefail: show errors that occur when piping one command to another

Hat tip and more details: http://redsymbol.net/articles/unofficial-bash-strict-mode/