Debugging shell scripts
Posted on September 9th, 1997 by shacker
All bash shell scripts must begin with the string:‘
#!/bin/sh
However, if you want to see exactly what’s going on while a script is running, start your script with
instead. The shell will report back to you with every step, making it much easier to see exactly what’s going on (and thus how to fix it if necessary).