Shell Scripting - Debugging Shell Scripts
There are various ways of debugging shell scripts, i found these useful when debugging UNIX/LINUX related installer issues.- Add the line set -vx in the beginning of the script. The shell script will then start debug output. You can disable the debug message by adding set +vx from that point onwards debug messages will be disabled
- Or doing sh -x shellscriptfilename (best option out the lot)
- This is similar to the first one except it will be applicable for the complete shell script. By adding
#!/bin/sh -vx
to the beginning of the shell script
Labels: Debugging, Script, Shell Script
About this entry
You’re currently reading “
- Published:
- 2:36 am
- by -
0 Comments (Post a Comment)