Preface: This article was originally posted here on my personal blog. Often times developers go about writing bash scripts the same as writing code in a higher-level language. This is a big mistake as higher-level languages offer safeguards that are not present in bash scripts by default. For example, a Ruby script will throw an error when trying to read from an uninitialized variable, whereas a b
![Safer bash scripts with 'set -euxo pipefail' (Example)](https://cdn-ak-scissors.b.st-hatena.com/image/square/b914422028dfacc206a193a2d15317c2574658b6/height=288;version=1;width=512/https%3A%2F%2Fcoderwall-assets-0.s3.amazonaws.com%2Fuploads%2Fuser%2Favatar%2F86567%2Fb00f469c4ccbb33bba69611325c29a3e.jpeg)