The shopt builtin command
shopt builtin manages shell options, a set of boolean (
off) configuration variables that control the behaviour of the shell.
shopt [-pqsu] [-o] <OPTNAME...>
Note: Some of these options and other shell options can also be set with the set builtin.
|Restrict the values of
|Print all shell options and their current value. Default.|
|Quiet mode. Set exit code if named option is set. For multiple options:
|Enable (set) the shell options named by
|Disabe (unset) the shell options named by
As noted above, if only
-u are given without any option names, only the currently enabled (
-s) or disabled (
-u) options are printed.
When listing options, the exit code is
TRUE (0), if all options are enabled,
When setting/unsetting an option, the exit code is
TRUE unless the named option doesn't exitst.
shopt -s nullglob
shopt command is not portable accross different shells.