Strict Error Settings

・1 min read

I recently revisited an old project and tried to get it up and running. First thing I noticed is that I'm providing the user terrible error messages because even I couldn't tell what was going on. Second thing I noticed was that I didn't follow best practices for writing bash scripts. I was being too lenient with errors and steamrolling over real issues instead of stopping at the first sign of trouble. Lesson for anyone that reads this is to always have the following in any bash script

#!/bin/bash -eu
set -o pipefail
# Rest of the script

Trust me, it will save you a lot of headache down the line.

Classic DEV Post from Aug 28 '18

Who's looking for open source contributors? (August 28 edition)

Please shamelessly promote your project. Everyone who posted in previous weeks ...

Dispassionate problem solver. I enjoy building minimal and efficient systems. I like to think I don't drink the kool-aid