Contents /
Previous /
Next
Internal Settings -- Debug
The set Command can modify certain
behavioral settings of the shell.
Your current options can be displayed with echo $-.
Various set commands are usually entered at the top
of a script or given as command-line options.
Using set +option instead of set -option disables
the option.
- set -e:
Exit immediately if any command gives an error.
- set -n:
Read commands without executing them.
This command is useful for syntax checking.
- set -C:
Do not overwrite existing files when using <.
- set -u:
Report an error when trying to
reference a variable that is unset.
Usually bash just fills in an empty string.
- set -v:
Print each line of script as it is executed.
- set -x:
Display each command expansion as it is executed.