Summary of debugging options for the set command

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

Short notation

Result

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.