set -x: Show debug info set -e: Exit on error set -u: Exit on unset variable is used

You can set these flags from terminal when calling script:

$ bash -vx ./my-script test