Summary of debugging options for the set command

The following table summarizes the various options for the set command:

Short notation


set -f

Disables globing. In this case, the filename expansions using wildcards or meta-characters will be disabled.

set -v

This will print the shell script lines as they are read by the shell.

set -x

This option will display each line after the variable substitution and command expansion, but before execution by the shell. This option is often called shell tracing.

set -n

This reads all commands and checks the syntax, but does not execute them.

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.