Differences between revisions 11 and 12
Revision 11 as of 2023-01-27 18:46:04
Size: 2054
Comment:
Revision 12 as of 2023-01-27 19:06:07
Size: 2443
Comment:
Deletions are marked like this. Additions are marked like this.
Line 59: Line 59:
If `cmdhist` is enabled and command history is enabled, multi-line commands are collapsed to a single line when saving into history. 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.
Line 61: Line 61:
This is enabled by default. If `histappend` is set, the history file is ''appended to'' rather than ''overwritten'' when the shell exits.

If `histreedit` is set and `readline(3)` is available, history can be re-editted.

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).

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.


Compatibility Levels

bash(1) 4 introduced compatibility levels, wherein the behavior of the shell are modified.

shopt -e 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.


Extended Debugging Mode

extdebug


History

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 histappend is set, the history file is appended to rather than overwritten when the shell exits.

If histreedit is set and readline(3) is available, history can be re-editted.

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).


Quoting

If extquote is enabled, ANSI quoting and local translation quoting are performed within parameter 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)