Summarizing the debugging options for the Bash shell

The following is a summary of various debugging options used for debugging, such as -x, -v, and -n with their details:

    $ bash -n script_name  // interpretation without execution
    $ bash -v script_name  // Display commands in script
    $ bash -x script_name  // Trace the execution of script
    
    $ bash -xv script_name    // Enable options x and v for debugging
    $ bash +xv script_name    //Disable options x and v for debugging
  

Get Learning Linux Shell Scripting - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.