Debug helpers in bash

set -x prints all variables you set, along with all commands you run. Invaluable while debugging my bash scripts.

set -e will stop the script on any errors.

man set will give you the rest.