Linux.com: Bugs in your shell script?

By John C. Zastrow

By: Larry Reckner
Topics: Shell
Subsection: Intermediate
If your writing a shell script and want to watch exactly what is going on (very usefull for debugging purposes), add the line

set -vx

in the beginning of the script.

The shell script will then output what it’s doing so you can watch.

This can also be done via command line by doing

</p>
<p>sh -x filename