Debugging on part(s) of the bash script

Using the set Bash built-in you can run in normal mode those portions of the script of
which you are sure they are without fault, and display debugging information only for troublesome zones.

Say we are not sure what the `uptime` command will do in a script, then we could enclose it in the script like this:

set -x # activate debugging from here
uptime
set +x # stop debugging from here

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.