May 2013
Beginner to intermediate
384 pages
7h 40m
English
Debugging is one of the critical features that every programming language should implement to produce race-back information when something unexpected happens. Debugging information can be used to read and understand what caused the program to crash or to act in an unexpected fashion. Bash provides certain debugging options that every sysadmin should know. This recipe shows how to use these.
We can either use Bash's inbuilt debugging tools or write our scripts in such a manner that they become easy to debug, here's how:
-x option to enable debug tracing of a shell script as follows:
$ bash -x script.sh
Running the script with the -x flag will print each source line with the current status. Note that you ...
Read now
Unlock full access