Chapter 15: Debugging Scripts

  • If we want to look at the verbose output from our script and the detailed information about the way the script is evaluated line by line, we can use the -v option, bash -v script_name.sh
  • The -x option, which displays the commands as they are executed, is more commonly used. Traces of each command plus its arguments are printed to standard output after the commands have been expanded but before they are executed.