| Start |
|---|
| Checking the syntax of a script with "-n" The -n flag enables you to check the syntax of a script without having to execute it: |
| Debugging usigh bashdb 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: Or get it from the homepage (opens new window). Then you can run it with your script as a paramater: Here are a few commands to get you started: For more information, I recommend consulting the manual: http://www.rodericksmith.plus.com/outlines/manuals/bashdbOutline.html (opens new window) See also homepage: |
| Debugging a bash script with "-x" 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: Or Turn on debugging within a bash script. It may optionally be turned back on, though debug output is automatically reset when the script exits. |
Read Article
https://develop.horje.com/learn/1434/reference