I’d been starting bash scripts with set -euo pipefail. I don’t really know where I got it from but it was something I’d picked up over the years. Aaron Maxwell has an excellent description of how this works and why it is a good idea. I also learned about the Internal File Seperator setting in that blog post and why that is a good idea. Read his excellent post. The net is that you should start your bash scripts with the following:

#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
bash