Size: 188
Comment:
|
Size: 4477
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
These options are set with the `shopt` builtin. | A POSIX compliant shell can be configured with the `set` and `unset` [[Bash/BuiltinCommands#Set|builtins]]. To inspect the enabled options, use the `$SHELLOPTS` [[Bash/ShellVariables#Not_Useful|shell variable]]. `bash(1)` expands on the set of configuration options. These options are set with the `shopt` [[Bash/BuiltinCommands#ShOpt|builtins]]. To inspect the enabled options, use the `$BASHOPTS` [[Bash/ShellVariables#Not_Useful|shell variable]]. |
Line 6: | Line 8: |
---- == Comments == If `interactive_comments` is enabled, the comment character (`#`) works in interactive shells. This is enabled by default. ---- == Compatibility Levels == `bash(1)` 4 introduced '''compatibility levels''', wherein the behavior of the shell are modified. {{{ shopt -e compat31 shopt -d compat31 }}} The modes available through the `shopt` builtin are: * `compat31` * `compat32` * `compat40` * `compat41` * `compat42` * `compat43` * `compat44` A shell only has one compatibility level, so each mode is mutually exclusive. From `bash(1)` 4.3+, use of the `$BASH_COMPAT` [[Bash/ShellVariables#Compatibility_Level|shell variable]] is preferred. ---- == Completion == If `progcomp` is enabled, [[Bash/Completion|programmable completion]] is used. This is enabled by default. If `progcomp_alias` is enabled, when completion fails for a word, the word is checked for an [[Bash/Alias|alias]]. If an alias is registered, completion is re-attempted based on the aliased value. If `force_fignore` is enabled and the `$FIGNORE` [[Bash/ShellVariables#Completion|shell variable]] is set, the filtered filenames will be ignored by completion even if they are the only possible expansions. This is enabled by default. If `hostcomplete` is enabled, hostname completion will be tried for any word containing `@`. This is enabled by default. ---- == Expansion == If `expand_aliases` is enabled, [[Bash/Alias|aliases]] are expanded. By default, this is enabled for interactive shells. `globasciiranges` `dotglob` `globstat` `nocaseglob` and `nocasematch` `direxpand` `dirspell` `failglob` |
|
Line 15: | Line 88: |
---- == History == If `history` is enabled, the history of commands is available for editting and re-execution. This behavior is configured with a set of [[Bash/ShellVariables#History|shell variables]]. If `cmdhist` is enabled and command history is enabled, multi-line commands are collapsed to a single line when saving into history. This is enabled by default. If `lithist` is enabled as well as `cmdhist`, multi-line commands are recorded in history with embedded newlines rather than semicolons. {{{ shopt -e lithist shopt -d lithist }}} If `histappend` is set, the history file is ''appended to'' rather than ''overwritten'' when the shell exits. {{{ shopt -e histappend shopt -d histappend }}} If `histreedit` is set and `readline(3)` is available, history can be re-editted. {{{ shopt -e histreedit shopt -d histreedit }}} If `histverify` is set, when a command is expanded with history substitution, the prompt reloads with the updated content (as opposed to the shell executing the updated command immediately). {{{ shopt -e histverify shopt -d histverify }}} ---- == Path == If `sourcepath` is enabled, the source [[Bash/BuiltinCommands#Source|builtin]] searches `$PATH` for the sourced file. ---- == Prompts == If `promptvars` is enabled, prompt strings undergo [[Bash/Expansion|expansion]] after sequences are expanded. This is enabled by default. ---- == Quoting == If `extquote` is enabled, [[Bash/Quoting#ANSI_Quoting|ANSI quoting]] and [[Bash/Quoting#Localization|local translation quoting]] are performed within [[Bash/Expansion#Parameter_Expansion|parameter expansion]]. This is enabled by default. If `complete_fullquote` is enabled, filenames containing special characters are quoted during [[Bash/Expansion#Filename_Expansion|filename expansion]]. This is enabled by default. ---- == Window Size == If `checkwinsize` is enabled, `bash(1)` checks the window size after every (non-builtin) command. This triggers updates to the `$LINES` and `$COLUMNS` [[Bash/ShellVariables#Not_Useful|shell variables]]. By default, this is enabled for interactive shells. |
Bash Shell Options
A POSIX compliant shell can be configured with the set and unset builtins. To inspect the enabled options, use the $SHELLOPTS shell variable.
bash(1) expands on the set of configuration options. These options are set with the shopt builtins. To inspect the enabled options, use the $BASHOPTS shell variable.
Contents
Comments
If interactive_comments is enabled, the comment character (#) works in interactive shells. This is enabled by default.
Compatibility Levels
bash(1) 4 introduced compatibility levels, wherein the behavior of the shell are modified.
shopt -e compat31 shopt -d compat31
The modes available through the shopt builtin are:
compat31
compat32
compat40
compat41
compat42
compat43
compat44
A shell only has one compatibility level, so each mode is mutually exclusive.
From bash(1) 4.3+, use of the $BASH_COMPAT shell variable is preferred.
Completion
If progcomp is enabled, programmable completion is used. This is enabled by default.
If progcomp_alias is enabled, when completion fails for a word, the word is checked for an alias. If an alias is registered, completion is re-attempted based on the aliased value.
If force_fignore is enabled and the $FIGNORE shell variable is set, the filtered filenames will be ignored by completion even if they are the only possible expansions. This is enabled by default.
If hostcomplete is enabled, hostname completion will be tried for any word containing @. This is enabled by default.
Expansion
If expand_aliases is enabled, aliases are expanded. By default, this is enabled for interactive shells.
globasciiranges
dotglob
globstat
nocaseglob and nocasematch
direxpand
dirspell
failglob
Extended Debugging Mode
extdebug
History
If history is enabled, the history of commands is available for editting and re-execution. This behavior is configured with a set of shell variables.
If cmdhist is enabled and command history is enabled, multi-line commands are collapsed to a single line when saving into history. This is enabled by default.
If lithist is enabled as well as cmdhist, multi-line commands are recorded in history with embedded newlines rather than semicolons.
shopt -e lithist shopt -d lithist
If histappend is set, the history file is appended to rather than overwritten when the shell exits.
shopt -e histappend shopt -d histappend
If histreedit is set and readline(3) is available, history can be re-editted.
shopt -e histreedit shopt -d histreedit
If histverify is set, when a command is expanded with history substitution, the prompt reloads with the updated content (as opposed to the shell executing the updated command immediately).
shopt -e histverify shopt -d histverify
Path
If sourcepath is enabled, the source builtin searches $PATH for the sourced file.
Prompts
If promptvars is enabled, prompt strings undergo expansion after sequences are expanded. This is enabled by default.
Quoting
If extquote is enabled, ANSI quoting and local translation quoting are performed within parameter expansion. This is enabled by default.
If complete_fullquote is enabled, filenames containing special characters are quoted during filename expansion. This is enabled by default.
Window Size
If checkwinsize is enabled, bash(1) checks the window size after every (non-builtin) command. This triggers updates to the $LINES and $COLUMNS shell variables. By default, this is enabled for interactive shells.