Tutorial by Examples

Use "-x" to enable debug output of executed lines. It can be run on an entire session or script, or enabled programmatically within a script. Run a script with debug output enabled: $ bash -x myscript.sh Or $ bash --debug myscript.sh Turn on debugging within a bash script. It may ...
The -n flag enables you to check the syntax of a script without having to execute it: ~> $ bash -n testscript.sh testscript.sh: line 128: unexpected EOF while looking for matching `"' testscript.sh: line 130: syntax error: unexpected end of file
Bashdb is a utility that is similar to gdb, in that you can do things like set breakpoints at a line or at a function, print content of variables, you can restart script execution and more. You can normally install it via your package manager, for example on Fedora: sudo dnf install bashdb Or ...

Page 1 of 1