Differences between revisions 12 and 13
Revision 12 as of 2023-01-27 19:06:07
Size: 2443
Comment:
Revision 13 as of 2023-01-27 19:31:09
Size: 4203
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
If `expand_aliases` is enabled, [[Bash/Alias|aliases]] are expanded. If `expand_aliases` is enabled, [[Bash/Alias|aliases]] are expanded. By default, this is enabled for interactive shells.
Line 17: Line 17:
By default, this is enabled for interactive shells. ----



== Comments ==

If `interactive_comments` is enabled, the comment character (`#`) works in interactive shells. This is enabled by default.
Line 29: Line 35:
shopt -d compat31
Line 49: Line 56:
== 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.

----


Line 59: Line 80:
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]].
Line 60: Line 83:

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
}}}
Line 63: Line 93:
{{{
shopt -e histappend
shopt -d histappend
}}}
Line 65: Line 100:
{{{
shopt -e histreedit
shopt -d histreedit
}}}
Line 66: Line 106:

{{{
shopt -e histverify
shopt -d histverify
}}}

----



== Prompts ==

If `promptvars` is enabled, prompt strings undergo [[Bash/Expansion|expansion]] after sequences are expanded. This is enabled by default.
Line 73: Line 126:
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]]. 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.
Line 75: Line 128:
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.
Line 83: Line 136:
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.
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.


Aliases

If expand_aliases is enabled, aliases are expanded. By default, this is enabled for interactive shells.


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.


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


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.


CategoryRicottone

Bash/ShellOptions (last edited 2023-04-03 03:07:16 by DominicRicottone)