How to Debug Bash Scripts - LinuxConfig.org

There are techniques from traditional programming environments that can help. Some basic tools like using an editor with syntax highlighting will help as well. There are builtin options that Bash provides to make debugging and your everyday Linux System Administration job easier.


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-debug-bash-scripts

It is possible to “set a breakpoint”, that is, get an interactive prompt inside a Bash script. This allows you to execute any shell commands and read values in local variables and finally continue script execution. Search for 01 org blog on Debugging Remote Scripts.