The shopt builtin

shopt [-pqsu] [-o] <OPTNAME...>

The shopt builtin manages shell options, a set of boolean (on/off) configuration variables that control the behaviour of the shell.

Some of these option can also be set with an option to the set builtin.

The options are named by <OPTNAME...>.

Options

OptionDescription
-oRestrict the values of <OPTNAME...> to only those also known by the set builtin
-pPrint all shell options and their current value. Default.
-qQuiet mode. Set exit code if named option is set. For multiple options: TRUE if all options are set, FALSE otherwise
-sEnable (set) the named options
-uDisabe (unset) the named options

If only -s or -u are given, only the currently enabled (-s) or disabled (-u) options are printed.

Exit code

When listing options, the exit code is TRUE (0), if all options are enabled, FALSE otherwise.

When setting/unsetting an option, the exit code is TRUE unless the named option doesn't exitst.

See also

commands/builtin/shopt.txt · Last modified: 2009/02/24 07:25 (external edit)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0