Linux.com: Bugs in your shell script?

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

sh -x filename

Be Sociable, Share!

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>