Debugging bash scripts

From Notes_Wiki
Revision as of 08:07, 5 August 2014 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>Shell_scripting|Shell scripting</yambe:breadcrumb> =Debugging shell scripts= Shell scripts can be debugged by calling them with -x and -v arguments such as:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>Shell_scripting|Shell scripting</yambe:breadcrumb>

Debugging shell scripts

Shell scripts can be debugged by calling them with -x and -v arguments such as:

bash -x a.sh

where:

-x
causes shell to print the commands being executed
-v
causes various input values to be printed as well

Refer to man bash and look for 'set' for more details