How do you make Bash scripts more robust?
set -euo pipefail.
-e=> exit if any command has non-zero status
-u => exit on undefined variables
-o pipefail => use failure code for entire pipeline instead of just last status code. Useful when you’re piping commands and don’t want the errors masked.