Debugging bash scripts

Unlike many programming languages, shell(bash) scripting has no official tool for debugging. Besides the classic “prints”, I was not aware that bash has some built-in mechanisms for tracing, until I decided to “read the manual”. As I was struggling with understanding some large shell scripts (that I did not write myself), I found some valuable information just by running man bash . To my surprise,…