Classic Shell Scripting - Arnold Robbins [204]
-q
Quiet mode. The exit status indicates if the option is set. With multiple options, the status is zero if they are all enabled, nonzero otherwise.
-s
Set (enable) the given option.
-u
Unset (disable) the given option.
For -s and -u without named options, the display lists those options which are set or unset, respectively.
Behavior
Control the settings of various internal shell options. With no option or -p, print the settings. Use -p to print the settings in a form that can be reread later.
Caveats
Only in bash, not in ksh.
* * *
The list of options for bash version 3.0 follows. For each option, we describe the behavior when the option is set (enabled):
cdable_vars
When an argument to cd isn't a directory, bash treats it as a variable name, whose value is the target directory.
cdspell
If a cd to a directory fails, bash attempts several minor spelling corrections to see if it can find the real directory. If it finds a correction, it prints the name and changes to the computed directory. This option works only in interactive shells.
checkhash
As bash finds commands after a path search, it stores the path search results in a hash table, to speed up subsequent executions of the same command. The second time a command is executed, bash runs the command as stored in the hash table, on the assumption that it's still there. With this option, bash verifies that a filename stored in its hash table really exists before trying to execute it. If it's not found, bash does a regular path search.
checkwinsize
After each command, bash checks the window size, and updates the LINES and COLUMNS variables when the window size changes.
cmdhist
bash stores all lines of a multiline command in the history file. This makes it possible to reedit multiline commands.
dotglob
bash includes files whose names begin with . (dot) in the results of filename expansion.
execfail
bash does not exit if it cannot execute the command given to the exec built-in command (see Section 7.3.2). In any case, interactive shells do not exit if exec fails.
expand_aliases
bash expands aliases. This is the default for interactive shells.
extdebug
bash enables behavior needed for debuggers:
declare -F displays the source file name and line number for each function name argument.
When a command run by the DEBUG trap fails, the next command is skipped.
When a command run by the DEBUG trap inside a shell function or script sourced with . (dot) or source fails, the shell simulates a call to return.
The array variable BASH_ARGC is set. Each element holds the number of arguments for the corresponding function or dot-script invocation. Similarly, the BASH_ARGV array variable is set. Each element is one of the arguments passed to a function or dot-script. BASH_ARGV functions as a stack, with values being pushed on at each call. Thus, the last element is the last argument to the most recent function or script invocation.
Function tracing is enabled. Command substitutions, shell functions and subshells invoked via (...) inherit the DEBUG and RETURN traps. (The RETURN trap is run when a return is executed, or a script run with . [dot] or source finishes.)
Error tracing is enabled. Command substitutions, shell functions, and subshells invoked via (...) inherit the ERROR trap.
extglob
bash does extended pattern matching similar to that of ksh88. This is discussed in more detail in Section 14.3.3.
extquote
bash allows $'...' and $"..." within ${ variable } expansions inside double quotes.
failglob
When a pattern does not match filenames bash produces an error.
force_fignore
When doing completion, bash ignores words matching the list of suffixes in FIGNORE, even if such words are the only possible completions.
gnu_errfmt
bash prints error messages in the standard GNU format.
histappend
bash appends commands to the file named by the HISTFILE variable, instead of overwriting the file.
histreedit
When a history substitution fails, if the readline library