Debugging Bourne/Bash shell scripts

6 03 2012

To debug a shell script,

sh -n scriptfile.sh

will check for (most) syntax errors without actually executing the script, while

sh -v scriptfile.sh

will echo each command before executing it. Use them together:

sh -nv scriptfile.sh

to get a verbose syntax check.

http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/debugging.html


Actions

Information

Leave a Reply

Your email address will not be published. Required fields are marked *




Skip to toolbar