Any extra tips or tricks are welcome!
Yesterday I learned that set -x enables trace for a bash, sh, or zsh script and prints the trace to the terminal.
set -x
I write a lot of bash scripts that end up running in automation in some fashion.
#!/usr/bin/env bash set -euxo pipefail
Is pretty standard for me.
-e exit on error
-e
-o pipefail exit on pipeline fail
-o pipefail
-u error on unset variables
-u
-x trace
-x
I write a lot of bash scripts that end up running in automation in some fashion.
Is pretty standard for me.
-e
exit on error-o pipefail
exit on pipeline fail-u
error on unset variables-x
trace