documentation updates; test suite updates to reduce extraneous diff output; don't export BASHOPTS into running tests

This commit is contained in:
Chet Ramey
2025-01-09 16:13:16 -05:00
parent 5114e17172
commit 2ea356081d
35 changed files with 4139 additions and 3415 deletions
+9 -7
View File
@@ -152,7 +152,7 @@ l. There is a new `bash_source_fullpath' shopt option, which makes bash put
at configure time.
m. Posix mode now forces job notifications to occur when the new edition of
POSIX specifes (since it now specifies them).
POSIX specifies (since it now specifies them).
n. Interactive shells don't print job notifications while sourcing scripts.
@@ -325,7 +325,7 @@ vv. Fixed a bug that caused unset not to remove a function named a[b] if
ww. Posix mode doesn't perform function lookup for function names containing
a slash.
xx. <( and >( can now be used in funtion names.
xx. <( and >( can now be used in function names.
yy. Fixed a bug that caused tilde expansion not to be performed on some
array subscripts.
@@ -451,7 +451,7 @@ oooo. If the cd builtin uses $OLDPWD, allow it to use $CDPATH if the user has
set it to something that's not a full pathname.
pppp. The test builtin only supports the optional argument to -t if parsing
an expression with more than four aguments and not in posix mode.
an expression with more than four arguments and not in posix mode.
qqqq. Changes to filename quoting and rewriting to deal with NFC and NFD
Unicode forms (primarily for macOS).
@@ -618,7 +618,7 @@ a. Fixed a bug in clearing the visible line structure before redisplay.
b. Fix a bug where setlocale(3) returning NULL caused a crash.
c. Fixed signal checking in callback mode to handle signals that arrive before
readline restore's the application's signal handlers.
readline restores the application's signal handlers.
d. Fixed a bug with word completion where the directory name needs to be
dequoted and tilde-expanded.
@@ -675,7 +675,7 @@ u. Call the filename rewrite hook on the word being completed before comparing
strings.
v. Fix infinite recursion that can happen if someone binds a key that doesn't
have a different upper and lower case represenation to do-lowercase-version.
have a different upper and lower case representation to do-lowercase-version.
w. Check for non-ANSI (dumb) terminals a little more thoroughly.
@@ -718,12 +718,12 @@ j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
preserves the special assignment statement parsing for the declation
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
@@ -817,6 +817,8 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
j. There is a new rl_print_keybinding function that prints the key bindings
for a single bindable function specified by name.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-release, and
the previous version, bash-5.2-rc4.
+10 -7
View File
@@ -152,7 +152,7 @@ l. There is a new `bash_source_fullpath' shopt option, which makes bash put
at configure time.
m. Posix mode now forces job notifications to occur when the new edition of
POSIX specifes (since it now specifies them).
POSIX specifies (since it now specifies them).
n. Interactive shells don't print job notifications while sourcing scripts.
@@ -325,7 +325,7 @@ vv. Fixed a bug that caused unset not to remove a function named a[b] if
ww. Posix mode doesn't perform function lookup for function names containing
a slash.
xx. <( and >( can now be used in funtion names.
xx. <( and >( can now be used in function names.
yy. Fixed a bug that caused tilde expansion not to be performed on some
array subscripts.
@@ -451,7 +451,7 @@ oooo. If the cd builtin uses $OLDPWD, allow it to use $CDPATH if the user has
set it to something that's not a full pathname.
pppp. The test builtin only supports the optional argument to -t if parsing
an expression with more than four aguments and not in posix mode.
an expression with more than four arguments and not in posix mode.
qqqq. Changes to filename quoting and rewriting to deal with NFC and NFD
Unicode forms (primarily for macOS).
@@ -618,7 +618,7 @@ a. Fixed a bug in clearing the visible line structure before redisplay.
b. Fix a bug where setlocale(3) returning NULL caused a crash.
c. Fixed signal checking in callback mode to handle signals that arrive before
readline restore's the application's signal handlers.
readline restores the application's signal handlers.
d. Fixed a bug with word completion where the directory name needs to be
dequoted and tilde-expanded.
@@ -675,7 +675,7 @@ u. Call the filename rewrite hook on the word being completed before comparing
strings.
v. Fix infinite recursion that can happen if someone binds a key that doesn't
have a different upper and lower case represenation to do-lowercase-version.
have a different upper and lower case representation to do-lowercase-version.
w. Check for non-ANSI (dumb) terminals a little more thoroughly.
@@ -718,12 +718,12 @@ j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
preserves the special asisgnment statement parsing for the declaration
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
@@ -816,3 +816,6 @@ h. execute-named-command: a new bindable command that reads the name of a
i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
j. There is a new rl_print_keybinding function that prints the key bindings
for a single bindable function specified by name.
+6
View File
@@ -10790,3 +10790,9 @@ lib/readline/util.c
tests/printf7.sub,tests/cond-regexp2.sub
- accommodate different error messages across different systems
1/2/2025
--------
tests/run-all, tests/run-minimal
- BASHOPTS: unset or unexport as appropriate, same as SHELLOPTS
From a report by Martin D Kealey <martin@kurahaupo.gen.nz>
+10 -7
View File
@@ -29,12 +29,12 @@ j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
preserves the special asisgnment statement parsing for the declaration
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
@@ -129,7 +129,7 @@ pp. There is a new `bash_source_fullpath' shopt option, which makes bash put
at configure time.
qq. Posix mode now forces job notifications to occur when the new edition of
POSIX specifes (since it now specifies them).
POSIX specifies (since it now specifies them).
rr. Interactive shells don't print job notifications while sourcing scripts.
@@ -175,16 +175,19 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
j. Documentation has been significantly updated.
j. There is a new rl_print_keybinding function that prints the key bindings
for a single bindable function specified by name.
k. New `force-meta-prefix' bindable variable, which forces the use of ESC as
k. Documentation has been significantly updated.
l. New `force-meta-prefix' bindable variable, which forces the use of ESC as
the meta prefix when using "\M-" in key bindings instead of overloading
convert-meta.
l. The default value for `readline-colored-completion-prefix' no longer has a
m. The default value for `readline-colored-completion-prefix' no longer has a
leading `.'; the original report was based on a misunderstanding.
m. There is a new bindable command, `export-completions', which writes the
n. There is a new bindable command, `export-completions', which writes the
possible completions for a word to the standard output in a defined format.
-------------------------------------------------------------------------------
+10 -7
View File
@@ -29,12 +29,12 @@ j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
preserves the special asisgnment statement parsing for the declaration
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
@@ -129,7 +129,7 @@ pp. There is a new `bash_source_fullpath' shopt option, which makes bash put
at configure time.
qq. Posix mode now forces job notifications to occur when the new edition of
POSIX specifes (since it now specifies them).
POSIX specifies (since it now specifies them).
rr. Interactive shells don't print job notifications while sourcing scripts.
@@ -175,14 +175,17 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
j. Documentation has been significantly updated.
j. There is a new rl_print_keybinding function that prints the key bindings
for a single bindable function specified by name.
k. New `force-meta-prefix' bindable variable, which forces the use of ESC as
k. Documentation has been significantly updated.
l. New `force-meta-prefix' bindable variable, which forces the use of ESC as
the meta prefix when using "\M-" in key bindings instead of overloading
convert-meta.
l. The default value for `readline-colored-completion-prefix' no longer has a
m. The default value for `readline-colored-completion-prefix' no longer has a
leading `.'; the original report was based on a misunderstanding.
m. There is a new bindable command, `export-completions', which writes the
n. There is a new bindable command, `export-completions', which writes the
possible completions for a word to the standard output in a defined format.
+1999 -1967
View File
File diff suppressed because it is too large Load Diff
+268 -128
View File
@@ -5,9 +5,13 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Thu Dec 12 13:37:07 EST 2024
.\" Last Change: Wed Jan 8 09:27:11 EST 2025
.\"
.\" bash_builtins, strip all but Builtins section
.\" For bash_builtins, strip all but "SHELL BUILTIN COMMANDS" section
.\" For rbash, strip all but "RESTRICTED SHELL" section
.\"
.\" Both conditionalize text based on the base page being formatted
.\" using the zZ and zY registers, respectively
.\"
.\" Ensure the registers are initialized to avoid groff warnings.
.nr zZ +0
@@ -17,7 +21,7 @@
.ds zY \" empty
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2024 December 12" "GNU Bash 5.3"
.TH BASH 1 "2025 January 8" "GNU Bash 5.3"
.\"
.ie \n(.g \{\
.ds ' \(aq
@@ -66,24 +70,40 @@ bash \- GNU Bourne-Again SHell
[options]
[command_string | file]
.SH COPYRIGHT
.if n Bash is Copyright (C) 1989-2024 by the Free Software Foundation, Inc.
.if t Bash is Copyright \(co 1989-2024 by the Free Software Foundation, Inc.
.if n Bash is Copyright (C) 1989-2025 by the Free Software Foundation, Inc.
.if t Bash is Copyright \(co 1989-2025 by the Free Software Foundation, Inc.
.SH DESCRIPTION
.B Bash
is an \fBsh\fP-compatible command language interpreter that
is a command language interpreter that
executes commands read from the standard input, from a string,
or from a file.
It is a reimplementation and extension of the Bourne shell,
the historical Unix command language interpreter.
.B Bash
also incorporates useful features from the \fIKorn\fP and \fIC\fP
shells (\fBksh\fP and \fBcsh\fP).
.PP
POSIX is the name for a family of computing standards based on Unix.
.SM POSIX
is the name for a family of computing standards based on Unix.
.B Bash
is intended to be a conformant implementation of the
Shell and Utilities portion of the IEEE POSIX specification
(IEEE Standard 1003.1).
Shell and Utilities portion of the IEEE
.SM POSIX
specification (IEEE Standard 1003.1).
.B Bash
can be configured to be POSIX-conformant by default.
.SM POSIX
mode (hereafter referred to as \fIposix mode\fP)
changes the shell's behavior where its default operation differs
from the standard to strictly conform to the standard.
See
.SM
.B "SEE ALSO"
below for a reference to a document that details how posix mode affects
\fBbash\fP's behavior.
.B Bash
can be configured to be
.SM POSIX\c
-conformant by default.
.SH OPTIONS
All of the single-character shell options documented in the
description of the \fBset\fP builtin command, including \fB\-o\fP,
@@ -244,13 +264,11 @@ This option is on by default if the shell is invoked as
.BR sh .
.TP
.B \-\-posix
Change the behavior of \fBbash\fP where the default operation differs
from the POSIX standard to match the standard (\fIposix mode\fP).
See
.SM
.B "SEE ALSO"
below for a reference to a document that details how posix mode affects
\fBBash\fP's behavior.
Enable posix mode;
change the behavior of \fBbash\fP
where the default operation differs from the
.SM POSIX
standard to match the standard.
.TP
.B \-\-restricted
The shell becomes restricted (see
@@ -270,9 +288,9 @@ If arguments remain after option processing, and neither the
.B \-c
nor the
.B \-s
option has been supplied, the first argument is assumed to
be the name of a file containing shell commands (a \fIshell script\fP).
If
option has been supplied, the first argument is treated as
the name of a file containing shell commands (a \fIshell script\fP).
When
.B bash
is invoked in this fashion,
.B $0
@@ -283,8 +301,9 @@ reads and executes commands from this file, then exits.
\fBBash\fP's exit status is the exit status of the last command
executed in the script.
If no commands are executed, the exit status is 0.
Bash first attempts to open the file in the current directory, and,
if no file is found, then searches the directories in
.B Bash
first attempts to open the file in the current directory,
and, if no file is found, searches the directories in
.SM
.B PATH
for the script.
@@ -295,12 +314,12 @@ or one started with the
.B \-\-login
option.
.PP
An \fIinteractive\fP shell is one started without non-option arguments
An \fIinteractive shell\fP is one started without non-option arguments
(unless \fB\-s\fP is specified)
and without the
.B \-c
option,
whose standard input and standard error are
and whose standard input and standard error are
both connected to terminals (as determined by
.IR isatty (3)),
or one started with the
@@ -397,10 +416,12 @@ is invoked with the name
it tries to mimic the startup behavior of historical versions of
.B sh
as closely as possible,
while conforming to the POSIX standard as well.
while conforming to the
.SM POSIX
standard as well.
When invoked as an interactive login shell, or a non-interactive
shell with the \fB\-\-login\fP option, it first attempts to
read and execute commands from
shell with the \fB\-\-login\fP option, it first attempts to read
and execute commands from
.FN /etc/profile
and
.FN \*~/.profile ,
@@ -425,6 +446,7 @@ option has no effect.
A non-interactive shell invoked with the name
.B sh
does not attempt to read any other startup files.
.PP
When invoked as
.BR sh ,
.B bash
@@ -434,7 +456,9 @@ When
.B bash
is started in posix mode, as with the
.B \-\-posix
command line option, it follows the POSIX standard for startup files.
command line option, it follows the
.SM POSIX
standard for startup files.
In this mode, interactive shells expand the
.SM
.B ENV
@@ -605,7 +629,9 @@ If the
reserved word precedes a pipeline, the shell reports the
elapsed as well as user and system time consumed by its execution
when the pipeline terminates.
The \fB\-p\fP option changes the output format to that specified by POSIX.
The \fB\-p\fP option changes the output format to that specified by
.SM POSIX\c
\&.
When the shell is in posix mode, it does not recognize
\fBtime\fP as a reserved word if the next token begins with a
.Q \- .
@@ -784,8 +810,12 @@ instead of having any special pattern matching meaning.
An additional binary operator, \fB=\*~\fP, is available, with the same
precedence as \fB==\fP and \fB!=\fP.
When it is used, the string to the right of the operator is considered
a POSIX extended regular expression and matched accordingly
(using the POSIX \fIregcomp\fP and \fIregexec\fP interfaces
a
.SM POSIX
extended regular expression and matched accordingly
(using the
.SM POSIX
\fIregcomp\fP and \fIregexec\fP interfaces
usually described in
.IR regex (3)).
The return value is 0 if the string matches
@@ -973,7 +1003,7 @@ Using \fB;&\fP in place of \fB;;\fP causes execution to continue with
the \fIlist\fP associated with the next pattern list.
Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next
pattern list in the statement, if any, and execute any associated \fIlist\fP
if the match succeeds.
if the match succeeds,
continuing the case statement execution as if the pattern list had not matched.
The exit status is zero if no pattern matches.
.IP
@@ -1103,7 +1133,9 @@ parentheses are not supplied, the braces are recommended.
\fIcompound\-command\fP is executed whenever \fIfname\fP is specified as the
name of a simple command.
When in posix mode, \fIfname\fP must be a valid shell \fIname\fP
and may not be the name of one of the POSIX \fIspecial builtins\fP.
and may not be the name of one of the
.SM POSIX
\fIspecial builtins\fP.
In default mode, a function name can be any unquoted shell word that does
not contain \fB$\fP.
.PP
@@ -1221,8 +1253,8 @@ The special parameters
.B *
and
.B @
have special meaning when in double
quotes (see
have special meaning when in double quotes
(see
.SM
.B PARAMETERS
below).
@@ -1390,25 +1422,34 @@ one or more instances of the \fBcommand\fP builtin and retain these
assignment statement properties.
.PP
In the context where an assignment statement is assigning a value
to a shell variable or array index,
the += operator appends to or adds to
to a shell variable or array index, the
.Q +=
operator appends to or adds to
the variable's previous value.
This includes arguments to \fIdeclaration\fP commands such as
\fBdeclare\fP that accept assignment statements.
When += is applied to a variable
for which the \fBinteger\fP attribute has been set,
.B \%declare
that accept assignment statements.
When
.Q +=
is applied to a variable for which the
.B \%integer
attribute has been set,
the variable's current value and \fIvalue\fP are each evaluated as
arithmetic expressions,
and the sum of the results is assigned as the variable's value.
The current value is usually an integer constant, but may be an expression.
When += is applied to an array variable using compound assignment
When
.Q +=
is applied to an array variable using compound assignment
(see
.B Arrays
below), the
variable's value is not unset (as it is when using =), and new
values are appended to the array beginning at one greater than the array's
maximum index (for indexed arrays) or added as additional key\-value pairs
in an associative array.
below),
the variable's value is not unset
(as it is when using
.@ = ),
and new values are appended to the array
beginning at one greater than the array's maximum index (for indexed arrays)
or added as additional key\-value pairs in an associative array.
When applied to a string-valued variable, \fIvalue\fP is expanded and
appended to the variable's value.
.PP
@@ -1775,7 +1816,7 @@ have no effect, and it may not be unset.
.B BASH_LOADABLES_PATH
A colon-separated list of directories in which the
.B enable
command.
command
looks for
dynamically loadable builtins.
.TP
@@ -2170,7 +2211,9 @@ is unset, it loses its special properties, even if it is
subsequently reset.
.TP
.B READLINE_ARGUMENT
Any numeric argument given to a \fBreadline\fP command that was defined using
Any numeric argument given to a
.B \%readline
command that was defined using
.Q "bind \-x"
(see
.SM
@@ -2252,6 +2295,8 @@ If this variable is in the environment when
.B bash
starts up, the shell enables each option in the list before
reading any startup files.
If this variable is exported, child shells will enable each option
in the list.
This variable is read-only.
.TP
.B SHLVL
@@ -2367,9 +2412,10 @@ A sample value is
.TP
.B CHILD_MAX
Set the number of exited child status values for the shell to remember.
\fBBash\fP will not allow this value to be decreased below a POSIX-mandated
minimum, and there is a maximum value (currently 8192) that this may
not exceed.
\fBBash\fP will not allow this value to be decreased below a
.SM POSIX\c
-mandated minimum,
and there is a maximum value (currently 8192) that this may not exceed.
The minimum value is system-dependent.
.TP
.B COLUMNS
@@ -2569,7 +2615,9 @@ When this variable is assigned a value, the history file is truncated,
if necessary, to contain no more than that number of lines
by removing the oldest entries.
The history file is also truncated to this size after
writing it when a shell exits or by the \fBhistory\fP builtin.
writing it when a shell exits or by the
.B \%history
builtin.
If the value is 0, the history file is truncated to zero size.
Non-numeric values and numeric values less than zero inhibit truncation.
The shell sets the default value to the value of
@@ -2606,8 +2654,26 @@ and are added to the history regardless of the value of
.BR HISTIGNORE .
If the first line was not saved, the second and subsequent lines of
the command are not saved either.
The pattern matching honors the setting of the \fBextglob\fP shell
option.
The pattern matching honors the setting of the
.B \%extglob
shell option.
.IP
.SM
.B HISTIGNORE
subsumes some of the function of
.SM
.BR HISTCONTROL .
A pattern of
.Q &
is identical to
.Q \%ignoredups ,
and a pattern of
.Q "[ ]*"
is identical to
.Q \%ignorespace .
Combining these two patterns, separating them with a colon,
provides the functionality of
.Q \%ignoreboth .
.TP
.B HISTSIZE
The number of commands to remember in the command history (see
@@ -2656,7 +2722,7 @@ to obtain the list of possible hostname completions.
When
.SM
.B HOSTFILE
is unset, \fBbash\fP clears the the hostname list.
is unset, \fBbash\fP clears the hostname list.
.TP
.B IFS
The
@@ -2824,15 +2890,22 @@ The default path is system-dependent,
and is set by the administrator who installs
.BR bash .
A common value is
.na
.Q /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin .
.ad
.RS
.RS 5n
.EX
/usr/local/bin:/usr/local/sbin:\c
.if \n(LL<78n .br
/usr/bin:/usr/sbin:/bin:/sbin
.EE
.RE
.RE
.TP
.B POSIXLY_CORRECT
If this variable is in the environment when \fBbash\fP starts, the shell
enters posix mode before reading the startup files, as if the
.B \-\-posix
invocation option had been supplied. If it is set while the shell is
invocation option had been supplied.
If it is set while the shell is
running, \fBbash\fP enables posix mode, as if the command
.Q "set \-o posix"
had been executed.
@@ -3024,10 +3097,13 @@ The second character is the \fIquick substitution\fP character, normally
When it appears as the first character on the line,
history substitution repeats the previous command,
replacing one string with another.
The optional third character is the character which indicates that
the remainder of the line is a comment when found as the first character
of a word, normally
.Q \fB#\fP .
The optional third character is the
\fIhistory comment\fP
character, normally
.Q \fB#\fP ,
which indicates
that the remainder of the line is a comment
when it appears as the first character of a word.
The history comment character disables history substitution
for the remaining words on the line.
It does not necessarily cause the shell parser to treat the rest of the
@@ -3043,34 +3119,49 @@ There is no maximum
limit on the size of an array, nor any requirement that members
be indexed or assigned contiguously.
Indexed arrays are referenced using arithmetic expressions
that must expand to an integer and are zero-based;
that must expand to an integer
(see
.SM
.B
ARITHMETIC EVALUATION
below)
and are zero-based;
associative arrays are referenced using arbitrary strings.
Unless otherwise noted, indexed array indices must be non-negative integers.
.PP
An indexed array is created automatically if any variable is assigned to
using the syntax
\fIname\fP[\fIsubscript\fP]=\fIvalue\fP.
.RS
\fIname\fP[\fIsubscript\fP]=\fIvalue\fP
\&.
.RE
The
.I subscript
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero.
To explicitly declare an indexed array, use
.B declare \-a \fIname\fP
.RS
.BI "declare \-a\ " name
.RE
(see
.SM
.B "SHELL BUILTIN COMMANDS"
below).
.B declare \-a \fIname\fP[\fIsubscript\fP]
.RS
\fBdeclare \-a\fP \fIname\fP[\fIsubscript\fP]
.RE
is also accepted; the \fIsubscript\fP is ignored.
.PP
Associative arrays are created using
.BR "declare \-A \fIname\fP" .
.RS
.BI "declare \-A\ " name
.RE
\&.
.PP
Attributes may be
specified for an array variable using the
.B declare
Attributes may be specified for an array variable using the
.B \%declare
and
.B readonly
.B \%readonly
builtins.
Each attribute applies to all members of an array.
.PP
@@ -3119,7 +3210,9 @@ interpreted as relative to one greater than the maximum index of
\fIname\fP, so negative indices count back from the end of the
array, and an index of \-1 references the last element.
.PP
The += operator appends to an array variable when assigning
The
.Q +=
operator appends to an array variable when assigning
using the compound assignment syntax; see
.SM
.B PARAMETERS
@@ -3291,12 +3384,12 @@ need not exist.
Patterns to be brace expanded are formed from an optional
.IR preamble ,
followed by either a series of comma-separated strings or
a sequence expression between a pair of braces, followed by
an optional
a sequence expression between a pair of braces,
followed by an optional
.IR postscript .
The preamble is prefixed to each string contained
within the braces, and the postscript is then appended
to each resulting string, expanding left to right.
The preamble is prefixed to each string contained within the braces,
and the postscript is then appended to each resulting string,
expanding left to right.
.PP
Brace expansions may be nested.
The results of each expanded string are not sorted;
@@ -3310,12 +3403,9 @@ where \fIx\fP and \fIy\fP are either integers or single letters,
and \fIincr\fP, an optional increment, is an integer.
When integers are supplied, the expression expands to each number between
\fIx\fP and \fIy\fP, inclusive.
If either \fIx\fP or \fIy\fP begins with \fI0\fP,
If either \fIx\fP or \fIy\fP begins with a zero,
each generated term will contain the same number of digits,
zero-padding where necessary.
When either \fIx\fP or \fPy\fP begins with a zero, the shell
attempts to force all generated terms to contain the same number of digits,
zero-padding where necessary.
When letters are supplied, the expression expands to each character
lexicographically between \fIx\fP and \fIy\fP, inclusive,
using the default C locale.
@@ -3338,22 +3428,32 @@ and closing braces, and at least one unquoted comma or a valid
sequence expression.
Any incorrectly formed brace expansion is left unchanged.
.PP
A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its
A
.Q {
or
Q ,
may be quoted with a backslash to prevent its
being considered part of a brace expression.
To avoid conflicts with parameter expansion, the string \fB${\fP
is not considered eligible for brace expansion, and inhibits brace
expansion until the closing \fB}\fP.
To avoid conflicts with parameter expansion, the string
.Q ${
is not considered eligible for brace expansion,
and inhibits brace expansion until the closing
.Q } .
.PP
This construct is typically used as shorthand when the common
prefix of the strings to be generated is longer than in the
above example:
.RS
.PP
.RS
.EX
mkdir /usr/local/src/bash/{old,new,dist,bugs}
.EE
.RE
or
.RS
.EX
chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
.EE
.RE
.PP
Brace expansion introduces a slight incompatibility with
@@ -3363,14 +3463,15 @@ historical versions of
does not treat opening or closing braces specially when they
appear as part of a word, and preserves them in the output.
.B Bash
removes braces from words as a consequence of brace
expansion.
removes braces from words as a consequence of brace expansion.
For example, a word entered to
.B sh
as \fIfile{1,2}\fP
as
.Q file{1,2}
appears identically in the output.
\fBBash\fP outputs that word as
.I file1 file2
.B Bash
outputs that word as
.Q "file1 file2"
after brace expansion.
Start
.B bash
@@ -3464,8 +3565,9 @@ of variable assignments (as described above under
.SM
.BR PARAMETERS )
when they appear as arguments to simple commands.
\fBBash\fP does not do this, except for the \fIdeclaration\fP commands listed
above, when in posix mode.
\fBBash\fP does not do this,
except for the \fIdeclaration\fP commands listed above,
when in posix mode.
.SS Parameter Expansion
The
.Q \fB$\fP
@@ -4080,7 +4182,8 @@ This filename is
passed as an argument to the current command as the result of the
expansion.
.PP
If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to
If the
\fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to
the file provides input for \fIlist\fP.
If the
\fB<(\fP\fIlist\^\fP\fB)\fP form is used, reading the file
@@ -4090,7 +4193,7 @@ and the left parenthesis, otherwise the construct would be interpreted
as a redirection.
.PP
Process substitution is supported on systems that support named
pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files.
pipes (\fIFIFOs\fP) or the \fI/dev/fd\fP method of naming open files.
.PP
When available, process substitution is performed
simultaneously with parameter and variable expansion,
@@ -4301,7 +4404,8 @@ make
.Q .*
one of the patterns in
.SM
.BR GLOBIGNORE .
.B GLOBIGNORE\c
\&.
The
.B dotglob
option is disabled when
@@ -4313,11 +4417,12 @@ The
pattern matching honors the setting of the \fBextglob\fP shell
option.
.PP
The
The value of the
.SM
.B GLOBSORT
shell variable controls how the results of pathname expansion are sorted,
as described above.
as described above under
.BR "Shell Variables" .
.PP
\fBPattern Matching\fP
.PP
@@ -4395,7 +4500,9 @@ shell option.
Within a bracket expression,
\fIcharacter classes\fP can be specified using the syntax
\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the
following classes defined in the POSIX standard:
following classes defined in the
.SM POSIX
standard:
.IP
.RS
.B
@@ -4648,7 +4755,7 @@ and the
.B noclobber
option to the
.B set
builtin has been enabled, the redirection fails if the file
builtin command has been enabled, the redirection fails if the file
whose name results from the expansion of \fIword\fP exists and is
a regular file.
If the redirection operator is
@@ -4659,11 +4766,11 @@ and the
.B noclobber
option to the
.B set
builtin command is not enabled,
builtin is not enabled,
\fBbash\fP attempts the redirection
even if the file named by \fIword\fP exists.
.SS Appending Redirected Output
Redirecting output in this fashion opens
Redirecting output in this fashion opens
the file whose name results from the expansion of
.I word
for appending on file descriptor
@@ -5418,7 +5525,9 @@ is non-zero.
.TP
\fIstring1\fP \fB=\fP \fIstring2\fP
True if the strings are equal.
\fB=\fP should be used with the \fBtest\fP command for POSIX conformance.
\fB=\fP should be used with the \fBtest\fP command for
.SM POSIX
conformance.
When used with the \fB[[\fP command, this performs pattern matching as
described above (\fBCompound Commands\fP).
.TP
@@ -6948,7 +7057,7 @@ If set to zero, any existing history entries are deleted and no new entries
are saved.
If set to a value less than zero, the number of history entries is not
limited.
By default, \fBbash\fP sets the the maximum number of history entries to
By default, \fBbash\fP sets the maximum number of history entries to
the value of the \fBHISTSIZE\fP shell variable.
Setting \fIhistory\-size\fP to a non-numeric value will set
the maximum number of history entries to 500.
@@ -7329,11 +7438,11 @@ Words are composed of alphanumeric characters (letters and digits).
Move back to the start of the current or previous word.
Words are composed of alphanumeric characters (letters and digits).
.TP
.B shell\-forward\-word
.B shell\-forward\-word (M\-C\-f)
Move forward to the end of the next word.
Words are delimited by non-quoted shell metacharacters.
.TP
.B shell\-backward\-word
.B shell\-backward\-word (M\-C\-b)
Move back to the start of the current or previous word.
Words are delimited by non-quoted shell metacharacters.
.TP
@@ -7607,7 +7716,7 @@ Negative arguments have no effect.
.TP
.B transpose\-words (M\-t)
Drag the word before point past the word after point,
moving point over that word as well.
moving point past that word as well.
If point is at the end of the line, this transposes
the last two words on the line.
.TP
@@ -7810,7 +7919,7 @@ the number of matches \fIN\fP;
the word being completed;
.IP \(bu
\fIS\fP:\fIE\fP,
where S and E are the start and end offsets of the word
where \fIS\fP and \fIE\fP are the start and end offsets of the word
in the \fBreadline\fP line buffer; then
.IP \(bu
each match, one per line
@@ -8327,7 +8436,7 @@ and
.PP
On startup, \fBbash\fP initializes the history list
by reading history entries from the
the file named by the
file named by the
.SM
.B HISTFILE
variable (default
@@ -9163,7 +9272,7 @@ before attempting the directory change.
.IP
If \fBcd\fP uses a non-empty directory name from
.SM
.BR CDPATH,
.BR CDPATH ,
or if \fB\-\fP is the first argument, and the directory change is
successful, \fBcd\fP writes the absolute pathname of the new
working directory to the standard output.
@@ -9712,7 +9821,7 @@ subsequent assignments.
.PP
The return value is 0 unless an invalid option is encountered,
an attempt is made to define a function using
.Q "\-f foo=bar" .
.Q "\-f foo=bar" ,
an attempt is made to assign a value to a readonly variable,
an attempt is made to assign a value to an array variable without
using the compound assignment syntax (see
@@ -9895,7 +10004,7 @@ If \fB\-n\fP is supplied, each \fIname\fP is disabled; otherwise,
\fIname\fPs are enabled.
For example, to use the
.B test
binary found usin g
binary found using
.SM
.B PATH
instead of the shell builtin version, run
@@ -9909,7 +10018,8 @@ shell builtins.
If \fB\-n\fP is supplied, print only disabled builtins.
If \fB\-a\fP is supplied, the list printed includes all builtins, with an
indication of whether or not each is enabled.
The \fB\-s\fP option means to restrict the output to the POSIX
The \fB\-s\fP option means to restrict the output to the
.SM POSIX
\fIspecial\fP builtins.
.IP
The
@@ -9929,7 +10039,8 @@ to force a search of the current directory.
The
.B \-d
option will delete a builtin previously loaded with \fB\-f\fP.
If \fI\-s\fP is used with \fI\-f\fP, the new builtin becomes a POSIX
If \fI\-s\fP is used with \fI\-f\fP, the new builtin becomes a
.SM POSIX
special builtin.
.IP
If no options are supplied and a \fIname\fP is not a shell builtin,
@@ -10321,12 +10432,15 @@ If
is specified,
.B help
gives detailed help on all commands matching
.IR pattern ;
.I pattern
as described below;
otherwise it displays a list of
all the builtins and shell compound commands.
.IP
Options, if supplied, have the follow meanings:
.RS
.PD 0
.TP
.PD 0
.B \-d
Display a short description of each \fIpattern\fP
.TP
@@ -10338,6 +10452,21 @@ Display only a short usage synopsis for each \fIpattern\fP
.PD
.RE
.IP
If \fIpattern\fP contains pattern matching characters
(see
.SM
.B "Pattern Matching"
above)
it's treated as a shell pattern and
\fBhelp\fP prints the description of each
help topic matching \fIpattern\fP.
.IP
If not, and \fIpattern\fP exactly matches the name of a help topic,
\fBhelp\fP prints the description
associated with that topic.
Otherwise, \fBhelp\fP performs prefix matching and
prints the descriptions of all matching help topics.
.IP
The return status is 0 unless no command matches
.IR pattern .
.TP
@@ -11380,10 +11509,13 @@ commands in the pipeline exit successfully.
This option is disabled by default.
.TP 8
.B posix
Change the behavior of
Enable posix mode;
change the behavior of
.B bash
where the default operation differs
from the POSIX standard to match the standard (\fIposix mode\fP).
from the
.SM POSIX
standard to match the standard.
See
.SM
.B "SEE ALSO"
@@ -12271,7 +12403,8 @@ commands sort lexicographically using ASCII ordering.
.PP
The historical operator-precedence parsing with 4 or more arguments can
lead to ambiguities when it encounters strings that look like primaries.
The POSIX
The
.SM POSIX
standard has deprecated the \fB\-a\fP and \fB\-o\fP
primaries and enclosing expressions within parentheses.
Scripts should no longer use them.
@@ -12588,7 +12721,9 @@ allow this value to be set).
The pipe size in 512-byte blocks (this may not be set).
.TP
.B \-q
The maximum number of bytes in POSIX message queues.
The maximum number of bytes in
.SM POSIX
message queues.
.TP
.B \-r
The maximum real-time scheduling priority.
@@ -12906,14 +13041,18 @@ bash-4.1 and later use the current locale's collation sequence and
.PD 0
.RS
.IP \(bu
In \fIposix\fP mode, \fBtime\fP may be followed by options and still be
recognized as a reserved word (this is POSIX interpretation 267).
In posix mode, \fBtime\fP may be followed by options and still be
recognized as a reserved word (this is
.SM POSIX
interpretation 267).
.IP \(bu
In \fIposix\fP mode, the parser requires that an even number of single
quotes occur in the \fIword\fP portion of a double-quoted
parameter expansion and treats them specially, so that characters within
the single quotes are considered quoted
(this is POSIX interpretation 221).
(this is
.SM POSIX
interpretation 221).
.RE
.PD
.TP
@@ -12927,7 +13066,9 @@ undergo quote removal, as it does in versions after bash-4.2.
In posix mode, single quotes are considered special when expanding
the \fIword\fP portion of a double-quoted parameter expansion
and can be used to quote a closing brace or other special character
(this is part of POSIX interpretation 221);
(this is part of
.SM POSIX
interpretation 221);
in later versions, single quotes
are not special within double-quoted word expansions.
.RE
@@ -13246,7 +13387,7 @@ The hardware and operating system
.TP
The compiler used to compile
.TP
A description of the bug behaviour
A description of the bug behavior
.TP
A short script or \c
.Q recipe " \c"
@@ -13268,8 +13409,7 @@ There are some subtle differences between
and traditional versions of
.BR sh ,
mostly because of the
.SM
.B POSIX
.SM POSIX
specification.
.PP
Aliases are confusing in some uses.
+288 -125
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2024 December 12<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2025 January 8<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -48,30 +48,48 @@ bash - GNU Bourne-Again SHell
<H3>COPYRIGHT</H3>
Bash is Copyright &#169; 1989-2024 by the Free Software Foundation, Inc.
Bash is Copyright &#169; 1989-2025 by the Free Software Foundation, Inc.
<A NAME="lbAE">&nbsp;</A>
<H3>DESCRIPTION</H3>
<B>Bash</B>
is an <B>sh</B>-compatible command language interpreter that
is a command language interpreter that
executes commands read from the standard input, from a string,
or from a file.
It is a reimplementation and extension of the Bourne shell,
the historical Unix command language interpreter.
<B>Bash</B>
also incorporates useful features from the <I>Korn</I> and <I>C</I>
shells (<B>ksh</B> and <B>csh</B>).
<P>
POSIX is the name for a family of computing standards based on Unix.
<FONT SIZE=-1>POSIX</FONT>
is the name for a family of computing standards based on Unix.
<B>Bash</B>
is intended to be a conformant implementation of the
Shell and Utilities portion of the IEEE POSIX specification
(IEEE Standard 1003.1).
Shell and Utilities portion of the IEEE
<FONT SIZE=-1>POSIX</FONT>
specification (IEEE Standard 1003.1).
<B>Bash</B>
can be configured to be POSIX-conformant by default.
<FONT SIZE=-1>POSIX</FONT>
mode (hereafter referred to as <I>posix mode</I>)
changes the shell's behavior where its default operation differs
from the standard to strictly conform to the standard.
See
<FONT SIZE=-1><B>SEE ALSO</B>
</FONT>
below for a reference to a document that details how posix mode affects
<B>bash</B>'s behavior.
<B>Bash</B>
can be configured to be
<FONT SIZE=-1>POSIX</FONT>
-conformant by default.
<A NAME="lbAF">&nbsp;</A>
<H3>OPTIONS</H3>
@@ -294,14 +312,11 @@ This option is on by default if the shell is invoked as
<DT><B>--posix</B>
<DD>
Change the behavior of <B>bash</B> where the default operation differs
from the POSIX standard to match the standard (<I>posix mode</I>).
See
<FONT SIZE=-1><B>SEE ALSO</B>
</FONT>
below for a reference to a document that details how posix mode affects
<B>Bash</B>'s behavior.
Enable posix mode;
change the behavior of <B>bash</B>
where the default operation differs from the
<FONT SIZE=-1>POSIX</FONT>
standard to match the standard.
<DT><B>--restricted</B>
<DD>
@@ -331,9 +346,9 @@ If arguments remain after option processing, and neither the
nor the
<B>-s</B>
option has been supplied, the first argument is assumed to
be the name of a file containing shell commands (a <I>shell script</I>).
If
option has been supplied, the first argument is treated as
the name of a file containing shell commands (a <I>shell script</I>).
When
<B>bash</B>
is invoked in this fashion,
@@ -347,8 +362,10 @@ reads and executes commands from this file, then exits.
<B>Bash</B>'s exit status is the exit status of the last command
executed in the script.
If no commands are executed, the exit status is 0.
Bash first attempts to open the file in the current directory, and,
if no file is found, then searches the directories in
<B>Bash</B>
first attempts to open the file in the current directory,
and, if no file is found, searches the directories in
<FONT SIZE=-1><B>PATH</B>
</FONT>
@@ -365,13 +382,13 @@ or one started with the
option.
<P>
An <I>interactive</I> shell is one started without non-option arguments
An <I>interactive shell</I> is one started without non-option arguments
(unless <B>-s</B> is specified)
and without the
<B>-c</B>
option,
whose standard input and standard error are
and whose standard input and standard error are
both connected to terminals (as determined by
<I>isatty</I>(3)),
@@ -518,10 +535,12 @@ it tries to mimic the startup behavior of historical versions of
<B>sh</B>
as closely as possible,
while conforming to the POSIX standard as well.
while conforming to the
<FONT SIZE=-1>POSIX</FONT>
standard as well.
When invoked as an interactive login shell, or a non-interactive
shell with the <B>--login</B> option, it first attempts to
read and execute commands from
shell with the <B>--login</B> option, it first attempts to read
and execute commands from
<A HREF="file:/etc/profile"><I>/etc/profile</I></A>
@@ -557,6 +576,8 @@ A non-interactive shell invoked with the name
<B>sh</B>
does not attempt to read any other startup files.
<P>
When invoked as
<B>sh</B>,
@@ -571,7 +592,9 @@ When
is started in posix mode, as with the
<B>--posix</B>
command line option, it follows the POSIX standard for startup files.
command line option, it follows the
<FONT SIZE=-1>POSIX</FONT>
standard for startup files.
In this mode, interactive shells expand the
<FONT SIZE=-1><B>ENV</B>
@@ -806,7 +829,9 @@ If the
reserved word precedes a pipeline, the shell reports the
elapsed as well as user and system time consumed by its execution
when the pipeline terminates.
The <B>-p</B> option changes the output format to that specified by POSIX.
The <B>-p</B> option changes the output format to that specified by
<FONT SIZE=-1>POSIX</FONT>
.
When the shell is in posix mode, it does not recognize
<B>time</B> as a reserved word if the next token begins with a
@@ -1025,8 +1050,12 @@ instead of having any special pattern matching meaning.
An additional binary operator, <B>=~</B>, is available, with the same
precedence as <B>==</B> and <B>!=</B>.
When it is used, the string to the right of the operator is considered
a POSIX extended regular expression and matched accordingly
(using the POSIX <I>regcomp</I> and <I>regexec</I> interfaces
a
<FONT SIZE=-1>POSIX</FONT>
extended regular expression and matched accordingly
(using the
<FONT SIZE=-1>POSIX</FONT>
<I>regcomp</I> and <I>regexec</I> interfaces
usually described in
<I>regex</I>(3)).
@@ -1240,7 +1269,7 @@ Using <B>;&amp;</B> in place of <B>;;</B> causes execution to continue with
the <I>list</I> associated with the next pattern list.
Using <B>;;&amp;</B> in place of <B>;;</B> causes the shell to test the next
pattern list in the statement, if any, and execute any associated <I>list</I>
if the match succeeds.
if the match succeeds,
continuing the case statement execution as if the pattern list had not matched.
The exit status is zero if no pattern matches.
<DT><DD>
@@ -1390,7 +1419,9 @@ parentheses are not supplied, the braces are recommended.
<I>compound-command</I> is executed whenever <I>fname</I> is specified as the
name of a simple command.
When in posix mode, <I>fname</I> must be a valid shell <I>name</I>
and may not be the name of one of the POSIX <I>special builtins</I>.
and may not be the name of one of the
<FONT SIZE=-1>POSIX</FONT>
<I>special builtins</I>.
In default mode, a function name can be any unquoted shell word that does
not contain <B>$</B>.
</DL>
@@ -1550,8 +1581,8 @@ The special parameters
and
<B>@</B>
have special meaning when in double
quotes (see
have special meaning when in double quotes
(see
<FONT SIZE=-1><B>PARAMETERS</B>
</FONT>
@@ -1780,26 +1811,37 @@ assignment statement properties.
<P>
In the context where an assignment statement is assigning a value
to a shell variable or array index,
the += operator appends to or adds to
to a shell variable or array index, the
operator appends to or adds to
the variable's previous value.
This includes arguments to <I>declaration</I> commands such as
<B>declare</B> that accept assignment statements.
When += is applied to a variable
for which the <B>integer</B> attribute has been set,
<B>declare</B>
that accept assignment statements.
When
is applied to a variable for which the
<B>integer</B>
attribute has been set,
the variable's current value and <I>value</I> are each evaluated as
arithmetic expressions,
and the sum of the results is assigned as the variable's value.
The current value is usually an integer constant, but may be an expression.
When += is applied to an array variable using compound assignment
When
is applied to an array variable using compound assignment
(see
<B>Arrays</B>
below), the
variable's value is not unset (as it is when using =), and new
values are appended to the array beginning at one greater than the array's
maximum index (for indexed arrays) or added as additional key-value pairs
in an associative array.
below),
the variable's value is not unset
(as it is when using
and new values are appended to the array
beginning at one greater than the array's maximum index (for indexed arrays)
or added as additional key-value pairs in an associative array.
When applied to a string-valued variable, <I>value</I> is expanded and
appended to the variable's value.
<P>
@@ -1843,6 +1885,15 @@ array variables.
Namerefs can be unset using the <B>-n</B> option to the <B>unset</B> builtin.
Otherwise, if <B>unset</B> is executed with the name of a nameref variable
as an argument, the variable referenced by the nameref variable is unset.
<P>
When the shell starts, it reads its environment and creates a shell
variable from each environment variable that has a valid name,
as described below
(see
<FONT SIZE=-1><B>ENVIRONMENT</B>).
</FONT>
<A NAME="lbAV">&nbsp;</A>
<H4>Positional Parameters</H4>
@@ -2246,7 +2297,7 @@ have no effect, and it may not be unset.
A colon-separated list of directories in which the
<B>enable</B>
command.
command
looks for
dynamically loadable builtins.
<DT><B>BASH_MONOSECONDS</B>
@@ -2737,7 +2788,10 @@ subsequently reset.
<DT><B>READLINE_ARGUMENT</B>
<DD>
Any numeric argument given to a <B>readline</B> command that was defined using
Any numeric argument given to a
<B>readline</B>
command that was defined using
(see
<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B>
@@ -2841,6 +2895,8 @@ If this variable is in the environment when
starts up, the shell enables each option in the list before
reading any startup files.
If this variable is exported, child shells will enable each option
in the list.
This variable is read-only.
<DT><B>SHLVL</B>
@@ -2985,9 +3041,10 @@ A sample value is
<DD>
Set the number of exited child status values for the shell to remember.
<B>Bash</B> will not allow this value to be decreased below a POSIX-mandated
minimum, and there is a maximum value (currently 8192) that this may
not exceed.
<B>Bash</B> will not allow this value to be decreased below a
<FONT SIZE=-1>POSIX</FONT>
-mandated minimum,
and there is a maximum value (currently 8192) that this may not exceed.
The minimum value is system-dependent.
<DT><B>COLUMNS</B>
@@ -3232,7 +3289,10 @@ When this variable is assigned a value, the history file is truncated,
if necessary, to contain no more than that number of lines
by removing the oldest entries.
The history file is also truncated to this size after
writing it when a shell exits or by the <B>history</B> builtin.
writing it when a shell exits or by the
<B>history</B>
builtin.
If the value is 0, the history file is truncated to zero size.
Non-numeric values and numeric values less than zero inhibit truncation.
The shell sets the default value to the value of
@@ -3274,8 +3334,29 @@ and are added to the history regardless of the value of
</FONT>
If the first line was not saved, the second and subsequent lines of
the command are not saved either.
The pattern matching honors the setting of the <B>extglob</B> shell
option.
The pattern matching honors the setting of the
<B>extglob</B>
shell option.
<DT><DD>
<FONT SIZE=-1><B>HISTIGNORE</B>
</FONT>
subsumes some of the function of
<FONT SIZE=-1><B>HISTCONTROL</B>.
</FONT>
A pattern of
is identical to
and a pattern of
is identical to
Combining these two patterns, separating them with a colon,
provides the functionality of
<DT><B>HISTSIZE</B>
<DD>
@@ -3337,7 +3418,7 @@ When
<FONT SIZE=-1><B>HOSTFILE</B>
</FONT>
is unset, <B>bash</B> clears the the hostname list.
is unset, <B>bash</B> clears the hostname list.
<DT><B>IFS</B>
<DD>
@@ -3555,8 +3636,18 @@ and is set by the administrator who installs
<B>bash</B>.
A common value is
<DL COMPACT><DT><DD>
<DL COMPACT><DT><DD>
/usr/local/bin:/usr/local/sbin:
<BR>
/usr/bin:/usr/sbin:/bin:/sbin
</DL>
</DL>
<DT><B>POSIXLY_CORRECT</B>
@@ -3565,7 +3656,8 @@ If this variable is in the environment when <B>bash</B> starts, the shell
enters posix mode before reading the startup files, as if the
<B>--posix</B>
invocation option had been supplied. If it is set while the shell is
invocation option had been supplied.
If it is set while the shell is
running, <B>bash</B> enables posix mode, as if the command
had been executed.
@@ -3801,10 +3893,13 @@ The second character is the <I>quick substitution</I> character, normally
When it appears as the first character on the line,
history substitution repeats the previous command,
replacing one string with another.
The optional third character is the character which indicates that
the remainder of the line is a comment when found as the first character
of a word, normally
The optional third character is the
<I>history comment</I>
character, normally
which indicates
that the remainder of the line is a comment
when it appears as the first character of a word.
The history comment character disables history substitution
for the remaining words on the line.
It does not necessarily cause the shell parser to treat the rest of the
@@ -3825,39 +3920,57 @@ There is no maximum
limit on the size of an array, nor any requirement that members
be indexed or assigned contiguously.
Indexed arrays are referenced using arithmetic expressions
that must expand to an integer and are zero-based;
that must expand to an integer
(see
<FONT SIZE=-1><B>ARITHMETIC EVALUATION</B>
</FONT>
below)
and are zero-based;
associative arrays are referenced using arbitrary strings.
Unless otherwise noted, indexed array indices must be non-negative integers.
<P>
An indexed array is created automatically if any variable is assigned to
using the syntax
<I>name</I>[<I>subscript</I>]=<I>value</I>.
<DL COMPACT><DT><DD>
<I>name</I>[<I>subscript</I>]=<I>value</I>
.
</DL>
The
<I>subscript</I>
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero.
To explicitly declare an indexed array, use
<B>declare -a </B><I>name</I>
<DL COMPACT><DT><DD>
<B>declare -a&nbsp;</B><I>name</I>
</DL>
(see
<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B>
</FONT>
below).
<B>declare -a </B><I>name</I>[<I>subscript</I>]
<DL COMPACT><DT><DD>
<B>declare -a</B> <I>name</I>[<I>subscript</I>]
</DL>
is also accepted; the <I>subscript</I> is ignored.
<P>
Associative arrays are created using
<B>declare -A </B><I>name</I>.
<DL COMPACT><DT><DD>
<B>declare -A&nbsp;</B><I>name</I>
</DL>
.
<P>
Attributes may be
specified for an array variable using the
Attributes may be specified for an array variable using the
<B>declare</B>
and
@@ -3920,7 +4033,9 @@ interpreted as relative to one greater than the maximum index of
array, and an index of -1 references the last element.
<P>
The += operator appends to an array variable when assigning
The
operator appends to an array variable when assigning
using the compound assignment syntax; see
<FONT SIZE=-1><B>PARAMETERS</B>
@@ -4139,13 +4254,13 @@ Patterns to be brace expanded are formed from an optional
<I>preamble</I>,
followed by either a series of comma-separated strings or
a sequence expression between a pair of braces, followed by
an optional
a sequence expression between a pair of braces,
followed by an optional
<I>postscript</I>.
The preamble is prefixed to each string contained
within the braces, and the postscript is then appended
to each resulting string, expanding left to right.
The preamble is prefixed to each string contained within the braces,
and the postscript is then appended to each resulting string,
expanding left to right.
<P>
Brace expansions may be nested.
@@ -4161,12 +4276,9 @@ where <I>x</I> and <I>y</I> are either integers or single letters,
and <I>incr</I>, an optional increment, is an integer.
When integers are supplied, the expression expands to each number between
<I>x</I> and <I>y</I>, inclusive.
If either <I>x</I> or <I>y</I> begins with <I>0</I>,
If either <I>x</I> or <I>y</I> begins with a zero,
each generated term will contain the same number of digits,
zero-padding where necessary.
When either <I>x</I> or y begins with a zero, the shell
attempts to force all generated terms to contain the same number of digits,
zero-padding where necessary.
When letters are supplied, the expression expands to each character
lexicographically between <I>x</I> and <I>y</I>, inclusive,
using the default C locale.
@@ -4193,25 +4305,35 @@ sequence expression.
Any incorrectly formed brace expansion is left unchanged.
<P>
A <B>{</B> or <B>,</B> may be quoted with a backslash to prevent its
A
or
Q ,
may be quoted with a backslash to prevent its
being considered part of a brace expression.
To avoid conflicts with parameter expansion, the string <B>${</B>
is not considered eligible for brace expansion, and inhibits brace
expansion until the closing <B>}</B>.
To avoid conflicts with parameter expansion, the string
is not considered eligible for brace expansion,
and inhibits brace expansion until the closing
<P>
This construct is typically used as shorthand when the common
prefix of the strings to be generated is longer than in the
above example:
<DL COMPACT><DT><DD>
<P>
<DL COMPACT><DT><DD>
mkdir /usr/local/src/bash/{old,new,dist,bugs}
</DL>
or
<DL COMPACT><DT><DD>
chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
</DL>
<P>
@@ -4226,15 +4348,16 @@ does not treat opening or closing braces specially when they
appear as part of a word, and preserves them in the output.
<B>Bash</B>
removes braces from words as a consequence of brace
expansion.
removes braces from words as a consequence of brace expansion.
For example, a word entered to
<B>sh</B>
as <I>file{1,2}</I>
as
appears identically in the output.
<B>Bash</B> outputs that word as
<I>file1 file2</I>
<B>Bash</B>
outputs that word as
after brace expansion.
Start
@@ -4352,8 +4475,9 @@ of variable assignments (as described above under
</FONT>
when they appear as arguments to simple commands.
<B>Bash</B> does not do this, except for the <I>declaration</I> commands listed
above, when in posix mode.
<B>Bash</B> does not do this,
except for the <I>declaration</I> commands listed above,
when in posix mode.
<A NAME="lbBC">&nbsp;</A>
<H4>Parameter Expansion</H4>
@@ -5077,7 +5201,8 @@ passed as an argument to the current command as the result of the
expansion.
<P>
If the <B>&gt;(</B><I>list</I><B>)</B> form is used, writing to
If the
<B>&gt;(</B><I>list</I><B>)</B> form is used, writing to
the file provides input for <I>list</I>.
If the
<B>&lt;(</B><I>list</I><B>)</B> form is used, reading the file
@@ -5088,7 +5213,7 @@ as a redirection.
<P>
Process substitution is supported on systems that support named
pipes (<I>FIFOs</I>) or the <B>/dev/fd</B> method of naming open files.
pipes (<I>FIFOs</I>) or the <I>/dev/fd</I> method of naming open files.
<P>
When available, process substitution is performed
@@ -5369,9 +5494,10 @@ To get the old behavior of ignoring filenames beginning with a
make
one of the patterns in
<FONT SIZE=-1><B>GLOBIGNORE</B>.
<FONT SIZE=-1><B>GLOBIGNORE</B>
</FONT>
.
The
<B>dotglob</B>
@@ -5387,12 +5513,14 @@ pattern matching honors the setting of the <B>extglob</B> shell
option.
<P>
The
The value of the
<FONT SIZE=-1><B>GLOBSORT</B>
</FONT>
shell variable controls how the results of pathname expansion are sorted,
as described above.
as described above under
<B>Shell Variables</B>.
<P>
<B>Pattern Matching</B>
@@ -5491,7 +5619,9 @@ shell option.
Within a bracket expression,
<I>character classes</I> can be specified using the syntax
<B>[:</B><I>class</I><B>:]</B>, where <I>class</I> is one of the
following classes defined in the POSIX standard:
following classes defined in the
<FONT SIZE=-1>POSIX</FONT>
standard:
<DT><DD>
<DL COMPACT><DT><DD>
<B>
@@ -5816,7 +5946,7 @@ and the
option to the
<B>set</B>
builtin has been enabled, the redirection fails if the file
builtin command has been enabled, the redirection fails if the file
whose name results from the expansion of <I>word</I> exists and is
a regular file.
If the redirection operator is
@@ -5831,13 +5961,13 @@ and the
option to the
<B>set</B>
builtin command is not enabled,
builtin is not enabled,
<B>bash</B> attempts the redirection
even if the file named by <I>word</I> exists.
<A NAME="lbBM">&nbsp;</A>
<H4>Appending Redirected Output</H4>
Redirecting output in this fashion opens
Redirecting output in this fashion opens
the file whose name results from the expansion of
<I>word</I>
@@ -6823,7 +6953,9 @@ is non-zero.
<DT><I>string1</I> <B>=</B> <I>string2</I><DD>
True if the strings are equal.
<B>=</B> should be used with the <B>test</B> command for POSIX conformance.
<B>=</B> should be used with the <B>test</B> command for
<FONT SIZE=-1>POSIX</FONT>
conformance.
When used with the <B>[[</B> command, this performs pattern matching as
described above (<B>Compound Commands</B>).
<DT><I>string1</I> <B>!=</B> <I>string2</I><DD>
@@ -8786,7 +8918,7 @@ If set to zero, any existing history entries are deleted and no new entries
are saved.
If set to a value less than zero, the number of history entries is not
limited.
By default, <B>bash</B> sets the the maximum number of history entries to
By default, <B>bash</B> sets the maximum number of history entries to
the value of the <B>HISTSIZE</B> shell variable.
Setting <I>history-size</I> to a non-numeric value will set
the maximum number of history entries to 500.
@@ -9264,12 +9396,12 @@ Words are composed of alphanumeric characters (letters and digits).
<DD>
Move back to the start of the current or previous word.
Words are composed of alphanumeric characters (letters and digits).
<DT><B>shell-forward-word</B>
<DT><B>shell-forward-word (M-C-f)</B>
<DD>
Move forward to the end of the next word.
Words are delimited by non-quoted shell metacharacters.
<DT><B>shell-backward-word</B>
<DT><B>shell-backward-word (M-C-b)</B>
<DD>
Move back to the start of the current or previous word.
@@ -9603,7 +9735,7 @@ Negative arguments have no effect.
<DD>
Drag the word before point past the word after point,
moving point over that word as well.
moving point past that word as well.
If point is at the end of the line, this transposes
the last two words on the line.
<DT><B>shell-transpose-words (M-C-t)</B>
@@ -9854,7 +9986,7 @@ the number of matches <I>N</I>;
the word being completed;
<DT>*<DD>
<I>S</I>:<I>E</I>,
where S and E are the start and end offsets of the word
where <I>S</I> and <I>E</I> are the start and end offsets of the word
in the <B>readline</B> line buffer; then
<DT>*<DD>
each match, one per line
@@ -10483,7 +10615,7 @@ and
On startup, <B>bash</B> initializes the history list
by reading history entries from the
the file named by the
file named by the
<FONT SIZE=-1><B>HISTFILE</B>
</FONT>
@@ -11526,7 +11658,7 @@ is converted to
before attempting the directory change.
<DT><DD>
If <B>cd</B> uses a non-empty directory name from
<FONT SIZE=-1><B>CDPATH,</B>
<FONT SIZE=-1><B>CDPATH</B>,
</FONT>
or if <B>-</B> is the first argument, and the directory change is
@@ -12396,7 +12528,7 @@ If <B>-n</B> is supplied, each <I>name</I> is disabled; otherwise,
For example, to use the
<B>test</B>
binary found usin g
binary found using
<FONT SIZE=-1><B>PATH</B>
</FONT>
@@ -12420,7 +12552,8 @@ shell builtins.
If <B>-n</B> is supplied, print only disabled builtins.
If <B>-a</B> is supplied, the list printed includes all builtins, with an
indication of whether or not each is enabled.
The <B>-s</B> option means to restrict the output to the POSIX
The <B>-s</B> option means to restrict the output to the
<FONT SIZE=-1>POSIX</FONT>
<I>special</I> builtins.
<DT><DD>
The
@@ -12444,7 +12577,8 @@ The
<B>-d</B>
option will delete a builtin previously loaded with <B>-f</B>.
If <I>-s</I> is used with <I>-f</I>, the new builtin becomes a POSIX
If <I>-s</I> is used with <I>-f</I>, the new builtin becomes a
<FONT SIZE=-1>POSIX</FONT>
special builtin.
<DT><DD>
If no options are supplied and a <I>name</I> is not a shell builtin,
@@ -12935,16 +13069,19 @@ is specified,
<B>help</B>
gives detailed help on all commands matching
<I>pattern</I>;
<I>pattern</I>
as described below;
otherwise it displays a list of
all the builtins and shell compound commands.
<DT><DD>
Options, if supplied, have the follow meanings:
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT><B>-d</B>
<DT>
<DD>
<B>-d</B>
Display a short description of each <I>pattern</I>
<DT><B>-m</B>
@@ -12957,6 +13094,22 @@ Display only a short usage synopsis for each <I>pattern</I>
</DL></DL>
<DT><DD>
If <I>pattern</I> contains pattern matching characters
(see
<FONT SIZE=-1><B>Pattern Matching</B>
</FONT>
above)
it's treated as a shell pattern and
<B>help</B> prints the description of each
help topic matching <I>pattern</I>.
<DT><DD>
If not, and <I>pattern</I> exactly matches the name of a help topic,
<B>help</B> prints the description
associated with that topic.
Otherwise, <B>help</B> performs prefix matching and
prints the descriptions of all matching help topics.
<DT><DD>
The return status is 0 unless no command matches
<I>pattern</I>.
@@ -14201,11 +14354,14 @@ This option is disabled by default.
<DT><B>posix</B>
<DD>
Change the behavior of
Enable posix mode;
change the behavior of
<B>bash</B>
where the default operation differs
from the POSIX standard to match the standard (<I>posix mode</I>).
from the
<FONT SIZE=-1>POSIX</FONT>
standard to match the standard.
See
<FONT SIZE=-1><B>SEE ALSO</B>
@@ -15313,7 +15469,8 @@ commands sort lexicographically using ASCII ordering.
The historical operator-precedence parsing with 4 or more arguments can
lead to ambiguities when it encounters strings that look like primaries.
The POSIX
The
<FONT SIZE=-1>POSIX</FONT>
standard has deprecated the <B>-a</B> and <B>-o</B>
primaries and enclosing expressions within parentheses.
Scripts should no longer use them.
@@ -15713,7 +15870,9 @@ The pipe size in 512-byte blocks (this may not be set).
<DT><B>-q</B>
<DD>
The maximum number of bytes in POSIX message queues.
The maximum number of bytes in
<FONT SIZE=-1>POSIX</FONT>
message queues.
<DT><B>-r</B>
<DD>
@@ -16111,14 +16270,18 @@ bash-4.1 and later use the current locale's collation sequence and
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT>*<DD>
In <I>posix</I> mode, <B>time</B> may be followed by options and still be
recognized as a reserved word (this is POSIX interpretation 267).
In posix mode, <B>time</B> may be followed by options and still be
recognized as a reserved word (this is
<FONT SIZE=-1>POSIX</FONT>
interpretation 267).
<DT>*<DD>
In <I>posix</I> mode, the parser requires that an even number of single
quotes occur in the <I>word</I> portion of a double-quoted
parameter expansion and treats them specially, so that characters within
the single quotes are considered quoted
(this is POSIX interpretation 221).
(this is
<FONT SIZE=-1>POSIX</FONT>
interpretation 221).
</DL></DL>
@@ -16133,7 +16296,9 @@ undergo quote removal, as it does in versions after bash-4.2.
In posix mode, single quotes are considered special when expanding
the <I>word</I> portion of a double-quoted parameter expansion
and can be used to quote a closing brace or other special character
(this is part of POSIX interpretation 221);
(this is part of
<FONT SIZE=-1>POSIX</FONT>
interpretation 221);
in later versions, single quotes
are not special within double-quoted word expansions.
</DL></DL>
@@ -16525,7 +16690,7 @@ ALL bug reports should include:
<DT>The version number of <B>bash</B><DD>
<DT>The hardware and operating system<DD>
<DT>The compiler used to compile<DD>
<DT>A description of the bug behaviour<DD>
<DT>A description of the bug behavior<DD>
<DT>A short script or <DD>
which exercises the bug
@@ -16556,9 +16721,7 @@ and traditional versions of
<B>sh</B>,
mostly because of the
<FONT SIZE=-1><B>POSIX</B>
</FONT>
<FONT SIZE=-1>POSIX</FONT>
specification.
<P>
@@ -16586,7 +16749,7 @@ Array variables may not (yet) be exported.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2024 December 12<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2025 January 8<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -16695,7 +16858,7 @@ Array variables may not (yet) be exported.
<DT><A HREF="#lbDJ">BUGS</A><DD>
</DL>
<HR>
This document was created by man2html from /usr/local/src/bash/bash-20241207/doc/bash.1.<BR>
Time: 12 December 2024 13:38:21 EST
This document was created by man2html from /usr/local/src/bash/bash-20241227/doc/bash.1.<BR>
Time: 08 January 2025 09:33:16 EST
</BODY>
</HTML>
+305 -273
View File
@@ -1,12 +1,12 @@
This is bash.info, produced by makeinfo version 7.1 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 12 December 2024).
Bash shell (version 5.3, 8 January 2025).
This is Edition 5.3, last updated 12 December 2024, of The GNU Bash
This is Edition 5.3, last updated 8 January 2025, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2024 Free Software Foundation, Inc.
Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
@@ -26,10 +26,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 12 December 2024). The Bash home page is
Bash shell (version 5.3, 8 January 2025). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 12 December 2024, of The GNU Bash
This is Edition 5.3, last updated 8 January 2025, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -1448,7 +1448,7 @@ above. If a variable at the current local scope is unset, it remains so
function returns. Once the function returns, any instance of the
variable at a previous scope becomes visible. If the unset acts on a
variable at a previous scope, any instance of a variable with that name
that had been shadowed will become visible (see below how the
that had been shadowed becomes visible (see below how the
localvar_unset shell option changes this behavior).
The -f option to the declare (typeset) builtin command (*note
@@ -1550,6 +1550,10 @@ array variables. Namerefs can be unset using the -n option to the
is executed with the name of a nameref variable as an argument, the
variable referenced by the nameref variable is unset.
When the shell starts, it reads its environment and creates a shell
variable from each environment variable that has a valid name, as
described below (*note Environment::).

File: bash.info, Node: Positional Parameters, Next: Special Parameters, Up: Shell Parameters
@@ -1739,7 +1743,7 @@ to the context of the expansion or the text between the braces.
closing braces, and at least one unquoted comma or a valid sequence
expression. Any incorrectly formed brace expansion is left unchanged.
A { or , may be quoted with a backslash to prevent its being
A { or , may be quoted with a backslash to prevent its being
considered part of a brace expression. To avoid conflicts with
parameter expansion, the string ${ is not considered eligible for
brace expansion, and inhibits brace expansion until the closing }.
@@ -1750,6 +1754,16 @@ of the strings to be generated is longer than in the above example:
or
chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
Brace expansion introduces a slight incompatibility with historical
versions of sh. sh does not treat opening or closing braces
specially when they appear as part of a word, and preserves them in the
output. Bash removes braces from words as a consequence of brace
expansion. For example, a word entered to sh as file{1,2} appears
identically in the output. Bash outputs that word as file1 file2
after brace expansion. Start Bash with the +B option or disable brace
expansion with the +B option to the set command (*note Shell Builtin
Commands::) for strict sh compatibility.

File: bash.info, Node: Tilde Expansion, Next: Shell Parameter Expansion, Prev: Brace Expansion, Up: Shell Expansions
@@ -2377,7 +2391,7 @@ File: bash.info, Node: Arithmetic Expansion, Next: Process Substitution, Prev
3.5.5 Arithmetic Expansion
--------------------------
Arithmetic expansion evalutes an arithmetic expression and substitutes
Arithmetic expansion evaluates an arithmetic expression and substitutes
the result. The format for arithmetic expansion is:
$(( EXPRESSION ))
@@ -2530,9 +2544,9 @@ patterns in GLOBIGNORE. The dotglob option is disabled when
GLOBIGNORE is unset. The GLOBIGNORE pattern matching honors the
setting of the extglob shell option.
After the pattern is expanded and matched against filenames, the
value of the GLOBSORT shell variable controls how the results are
sorted, as described below (*note Bash Variables::).
The value of the GLOBSORT shell variable controls how the results
of pathname expansion are sorted, as described below (*note Bash
Variables::).

File: bash.info, Node: Pattern Matching, Up: Filename Expansion
@@ -2764,11 +2778,12 @@ created; if it does exist it is truncated to zero size.
[N]>[|]WORD
If the redirection operator is >, and the noclobber option to the
set builtin has been enabled, the redirection fails if the file whose
name results from the expansion of WORD exists and is a regular file.
If the redirection operator is >|, or the redirection operator is >
and the noclobber option is not enabled, Bash attemps the redirection
even if the file named by WORD exists.
set builtin command has been enabled, the redirection fails if the
file whose name results from the expansion of WORD exists and is a
regular file. If the redirection operator is >|, or the redirection
operator is > and the noclobber option to the set builtin is not
enabled, Bash attempts the redirection even if the file named by WORD
exists.
3.6.3 Appending Redirected Output
---------------------------------
@@ -3838,7 +3853,7 @@ standard.
The ACTION is a command that is read and executed when the shell
receives any of the signals SIGSPEC. If ACTION is absent (and
there is a single SIGSPEC) or equal to -, each specified
SIGSPEC'ss disposition is reset to the value it had when the shell
SIGSPEC's disposition is reset to the value it had when the shell
was started. If ACTION is the null string, then the signal
specified by each SIGSPEC is ignored by the shell and commands it
invokes.
@@ -4053,7 +4068,7 @@ standard.
optional, and Readline does not expand the command string
before saving it. Since the entire key binding expression
must be a single argument, it should be enclosed in single
quotes. When SHELL-COMMAND is executed, the shell sets thex
quotes. When SHELL-COMMAND is executed, the shell sets the
READLINE_LINE variable to the contents of the Readline line
buffer and the READLINE_POINT and READLINE_MARK variables
to the current location of the insertion point and the saved
@@ -4305,7 +4320,8 @@ standard.
BASH_LOADABLES_PATH is system-dependent, and may include "." to
force a search of the current directory. The -d option will
delete a builtin loaded with -f. If -s is used with -f, the
new builtin becomes a special builtin (*note Special Builtins::).
new builtin becomes a POSIX special builtin (*note Special
Builtins::).
If no options are supplied and a NAME is not a shell builtin,
enable will attempt to load NAME from a shared object named NAME,
@@ -4319,8 +4335,8 @@ standard.
Display helpful information about builtin commands. If PATTERN is
specified, help gives detailed help on all commands matching
PATTERN, otherwise it displays a list of all builtins and shell
compound commands.
PATTERN as described below; otherwise it displays a list of all
builtins and shell compound commands.
Options, if supplied, have the following meanings:
@@ -4332,6 +4348,15 @@ standard.
-s
Display only a short usage synopsis for each PATTERN
If PATTERN contains pattern matching characters (*note Pattern
Matching::) it's treated as a shell pattern and help prints the
description of each help topic matching PATTERN.
If not, and PATTERN exactly matches the name of a help topic,
help prints the description associated with that topic.
Otherwise, help performs prefix matching and prints the
descriptions of all matching help topics.
The return status is zero unless no command matches PATTERN.
let
@@ -4758,7 +4783,7 @@ standard.
Values are in 1024-byte increments, except for -t, which is in
seconds; -R, which is in microseconds; -p, which is in units of
512-byte blocks; -P, -T, -b, -k, -n and -u, which are
unscaled values; and, when in POSIX Mode (*note Bash POSIX Mode::),
unscaled values; and, when in POSIX mode (*note Bash POSIX Mode::),
-c and -f, which are in 512-byte increments.
The return status is zero unless an invalid option or argument is
@@ -4957,10 +4982,11 @@ parameters, or to display the names and values of shell variables.
successfully. This option is disabled by default.
posix
Change the behavior of Bash where the default operation
differs from the POSIX standard to match the standard
(*note Bash POSIX Mode::). This is intended to make Bash
behave as a strict superset of that standard.
Enable POSIX mode; change the behavior of Bash where the
default operation differs from the POSIX standard to
match the standard (*note Bash POSIX Mode::). This is
intended to make Bash behave as a strict superset of that
standard.
privileged
Same as -p.
@@ -5878,7 +5904,7 @@ Variables::).
ENV
Expanded and executed similarly to BASH_ENV (*note Bash Startup
Files::) when an interactive shell is invoked in POSIX Mode (*note
Files::) when an interactive shell is invoked in POSIX mode (*note
Bash POSIX Mode::).
EPOCHREALTIME
@@ -5999,15 +6025,16 @@ Variables::).
substitution, and tokenization (*note History Interaction::). The
first character is the “history expansion” character, the character
which begins a history expansion, normally !. The second
character is the "quick substitution" character, normally ^.
character is the quick substitution character, normally ^.
When it appears as the first character on the line, history
substitution repeats the previous command, replacing one string
with another. The optional third character is the character which
indicates that the remainder of the line is a comment when found as
the first character of a word, usually #. The history comment
character disables history substitution for the remaining words on
the line. It does not necessarily cause the shell parser to treat
the rest of the line as a comment.
with another. The optional third character is the “history
comment” character, normally #, which indicates that the
remainder of the line is a comment when it appears as the first
character of a word. The history comment character disables
history substitution for the remaining words on the line. It does
not necessarily cause the shell parser to treat the rest of the
line as a comment.
HISTCMD
The history number, or index in the history list, of the current
@@ -6307,7 +6334,8 @@ Variables::).
SHELLOPTS are those reported as on by set -o. If this
variable is in the environment when Bash starts up, the shell
enables each option in the list before reading any startup files.
This variable is readonly.
If this variable is exported, child shells will enable each option
in the list. This variable is readonly.
SHLVL
Incremented by one each time a new instance of Bash is started.
@@ -6468,10 +6496,11 @@ single-character options to be recognized.
shell. This is on by default if the shell is invoked as sh.
--posix
Change the behavior of Bash where the default operation differs
from the POSIX standard to match the standard. This is intended to
make Bash behave as a strict superset of that standard. *Note Bash
POSIX Mode::, for a description of the Bash POSIX mode.
Enable POSIX mode; change the behavior of Bash where the default
operation differs from the POSIX standard to match the standard.
This is intended to make Bash behave as a strict superset of that
standard. *Note Bash POSIX Mode::, for a description of the Bash
POSIX mode.
--restricted
Equivalent to -r. Make the shell a restricted shell (*note The
@@ -6542,23 +6571,25 @@ invocation which are not available with the set builtin.
-
Equivalent to --.
A _login_ shell is one whose first character of argument zero is -,
A login shell is one whose first character of argument zero is -,
or one invoked with the --login option.
An _interactive_ shell is one started without non-option arguments,
An interactive shell is one started without non-option arguments,
unless -s is specified, without specifying the -c option, and whose
input and output (using the standard error) are both connected to
terminals (as determined by isatty(3)), or one started with the -i
option. *Note Interactive Shells::, for more information.
standard input and standard error are both connected to terminals (as
determined by isatty(3)), or one started with the -i option. *Note
Interactive Shells::, for more information.
If arguments remain after option processing, and neither the -c nor
the -s option has been supplied, the first argument is assumed to be
the name of a file containing shell commands (*note Shell Scripts::).
When Bash is invoked in this fashion, $0 is set to the name of the
file, and the positional parameters are set to the remaining arguments.
Bash reads and executes commands from this file, then exits. Bash's
exit status is the exit status of the last command executed in the
script. If no commands are executed, the exit status is 0.
the -s option has been supplied, the first argument is treated as the
name of a file containing shell commands (*note Shell Scripts::). When
Bash is invoked in this fashion, $0 is set to the name of the file,
and the positional parameters are set to the remaining arguments. Bash
reads and executes commands from this file, then exits. Bash's exit
status is the exit status of the last command executed in the script.
If no commands are executed, the exit status is 0. Bash first attempts
to open the file in the current directory, and, if no file is found,
searches the directories in PATH for the script.

File: bash.info, Node: Bash Startup Files, Next: Interactive Shells, Prev: Invoking Bash, Up: Bash Features
@@ -7155,7 +7186,7 @@ to using the syntax
The SUBSCRIPT is treated as an arithmetic expression that must evaluate
to a number greater than or equal to zero. To explicitly declare an
array, use
indexed array, use
declare -a NAME
(*note Bash Builtins::). The syntax
declare -a NAME[SUBSCRIPT]
@@ -7590,7 +7621,7 @@ editing commands were left out due to objections.
Although Bash is an implementation of the POSIX shell specification,
there are areas where the Bash default behavior differs from the
specification. The Bash “posix mode” changes the Bash behavior in these
areas so that it conforms more closely to the standard.
areas so that it conforms more strictly to the standard.
Starting Bash with the --posix command-line option or executing
set -o posix while Bash is running will cause Bash to conform more
@@ -7600,7 +7631,7 @@ specified by POSIX in areas where the Bash default differs.
When invoked as sh, Bash enters POSIX mode after reading the
startup files.
The following list is what's changed when 'POSIX mode' is in effect:
The following list is what's changed when POSIX mode is in effect:
1. Bash ensures that the POSIXLY_CORRECT variable is set.
@@ -7983,10 +8014,10 @@ required for bash-5.1 and later versions.
collation sequence and strcoll(3).
compat41
• In posix mode, time may be followed by options and still be
• In POSIX mode, time may be followed by options and still be
recognized as a reserved word (this is POSIX interpretation
267).
• In posix mode, the parser requires that an even number of
• In POSIX mode, the parser requires that an even number of
single quotes occur in the WORD portion of a double-quoted
${...} parameter expansion and treats them specially, so that
characters within the single quotes are considered quoted
@@ -7996,7 +8027,7 @@ required for bash-5.1 and later versions.
• The replacement string in double-quoted pattern substitution
does not undergo quote removal, as it does in versions after
bash-4.2.
• In posix mode, single quotes are considered special when
• In POSIX mode, single quotes are considered special when
expanding the WORD portion of a double-quoted ${...} parameter
expansion and can be used to quote a closing brace or other
special character (this is part of POSIX interpretation 221);
@@ -8005,7 +8036,7 @@ required for bash-5.1 and later versions.
compat43
• Word expansion errors are considered non-fatal errors that
cause the current command to fail, even in posix mode (the
cause the current command to fail, even in POSIX mode (the
default behavior is to make them fatal errors that cause the
shell to exit).
• When executing a shell function, the loop state
@@ -8024,7 +8055,7 @@ required for bash-5.1 and later versions.
• Variable assignments preceding builtins like export and
readonly that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode.
shell is not in POSIX mode.
compat50 (set using BASH_COMPAT)
• Bash-5.1 changed the way $RANDOM is generated to introduce
@@ -8947,9 +8978,9 @@ Variable Settings
list. If set to zero, any existing history entries are
deleted and no new entries are saved. If set to a value less
than zero, the number of history entries is not limited. By
default, Bash sets the the maximum number of history entries
to the value of the HISTSIZE shell variable. If you try to
set HISTORY-SIZE to a non-numeric value, the maximum number of
default, Bash sets the maximum number of history entries to
the value of the HISTSIZE shell variable. If you try to set
HISTORY-SIZE to a non-numeric value, the maximum number of
history entries will be set to 500.
horizontal-scroll-mode
@@ -9229,7 +9260,7 @@ Key Bindings
When entering the text of a macro, single or double quotes must be
used to indicate a macro definition. Unquoted text is assumed to
be a function name. Tthe backslash escapes described above are
be a function name. The backslash escapes described above are
expanded in the macro body. Backslash will quote any other
character in the macro text, including " and '. For example,
the following binding will make ‘‘C-x \ insert a single \ into
@@ -9336,7 +9367,7 @@ File: bash.info, Node: Sample Init File, Prev: Conditional Init Constructs, U
Here is an example of an INPUTRC file. This illustrates key binding,
variable assignment, and conditional syntax.
# This file controls the behaviour of line input editing for
# This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
@@ -10112,8 +10143,9 @@ File: bash.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bin
Expand the line by performing shell word expansions. This performs
alias and history expansion, $'STRING' and $"STRING" quoting, tilde
expansion, parameter and variable expansion, arithmetic expansion,
command and proces substitution, word splitting, and quote removal.
An explicit argument suppresses command and process substitution.
command and process substitution, word splitting, and quote
removal. An explicit argument suppresses command and process
substitution.
history-expand-line (M-^)
Perform history expansion on the current line.
@@ -11781,7 +11813,7 @@ fix, you are encouraged to submit that as well! Suggestions and
• The version number of Bash.
• The hardware and operating system.
• The compiler used to compile Bash.
• A description of the bug behaviour.
• A description of the bug behavior.
• A short script or 'recipe' which exercises the bug and may be used
to reproduce it.
@@ -12780,26 +12812,26 @@ D.1 Index of Shell Builtin Commands
(line 179)
* hash: Bourne Shell Builtins.
(line 231)
* help: Bash Builtins. (line 374)
* help: Bash Builtins. (line 375)
* history: Bash History Builtins.
(line 59)
* jobs: Job Control Builtins.
(line 28)
* kill: Job Control Builtins.
(line 61)
* let: Bash Builtins. (line 394)
* local: Bash Builtins. (line 403)
* logout: Bash Builtins. (line 428)
* mapfile: Bash Builtins. (line 433)
* let: Bash Builtins. (line 404)
* local: Bash Builtins. (line 413)
* logout: Bash Builtins. (line 438)
* mapfile: Bash Builtins. (line 443)
* popd: Directory Stack Builtins.
(line 37)
* printf: Bash Builtins. (line 478)
* printf: Bash Builtins. (line 488)
* pushd: Directory Stack Builtins.
(line 70)
* pwd: Bourne Shell Builtins.
(line 263)
* read: Bash Builtins. (line 548)
* readarray: Bash Builtins. (line 659)
* read: Bash Builtins. (line 558)
* readarray: Bash Builtins. (line 669)
* readonly: Bourne Shell Builtins.
(line 275)
* return: Bourne Shell Builtins.
@@ -12808,7 +12840,7 @@ D.1 Index of Shell Builtin Commands
* shift: Bourne Shell Builtins.
(line 325)
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 668)
* source: Bash Builtins. (line 678)
* suspend: Job Control Builtins.
(line 139)
* test: Bourne Shell Builtins.
@@ -12819,12 +12851,12 @@ D.1 Index of Shell Builtin Commands
(line 444)
* true: Bourne Shell Builtins.
(line 510)
* type: Bash Builtins. (line 673)
* typeset: Bash Builtins. (line 710)
* ulimit: Bash Builtins. (line 716)
* type: Bash Builtins. (line 683)
* typeset: Bash Builtins. (line 720)
* ulimit: Bash Builtins. (line 726)
* umask: Bourne Shell Builtins.
(line 515)
* unalias: Bash Builtins. (line 824)
* unalias: Bash Builtins. (line 834)
* unset: Bourne Shell Builtins.
(line 533)
* wait: Job Control Builtins.
@@ -12999,55 +13031,55 @@ D.3 Parameter and Variable Index
* GLOBSORT: Bash Variables. (line 376)
* GROUPS: Bash Variables. (line 414)
* histchars: Bash Variables. (line 420)
* HISTCMD: Bash Variables. (line 435)
* HISTCONTROL: Bash Variables. (line 441)
* HISTFILE: Bash Variables. (line 459)
* HISTFILESIZE: Bash Variables. (line 465)
* HISTIGNORE: Bash Variables. (line 476)
* HISTCMD: Bash Variables. (line 436)
* HISTCONTROL: Bash Variables. (line 442)
* HISTFILE: Bash Variables. (line 460)
* HISTFILESIZE: Bash Variables. (line 466)
* HISTIGNORE: Bash Variables. (line 477)
* history-preserve-point: Readline Init File Syntax.
(line 234)
* history-size: Readline Init File Syntax.
(line 240)
* HISTSIZE: Bash Variables. (line 500)
* HISTTIMEFORMAT: Bash Variables. (line 507)
* HISTSIZE: Bash Variables. (line 501)
* HISTTIMEFORMAT: Bash Variables. (line 508)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 250)
* HOSTFILE: Bash Variables. (line 516)
* HOSTNAME: Bash Variables. (line 527)
* HOSTTYPE: Bash Variables. (line 530)
* HOSTFILE: Bash Variables. (line 517)
* HOSTNAME: Bash Variables. (line 528)
* HOSTTYPE: Bash Variables. (line 531)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 533)
* IGNOREEOF: Bash Variables. (line 534)
* input-meta: Readline Init File Syntax.
(line 258)
* INPUTRC: Bash Variables. (line 542)
* INSIDE_EMACS: Bash Variables. (line 546)
* INPUTRC: Bash Variables. (line 543)
* INSIDE_EMACS: Bash Variables. (line 547)
* isearch-terminators: Readline Init File Syntax.
(line 269)
* keymap: Readline Init File Syntax.
(line 276)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 552)
* LC_ALL: Bash Variables. (line 556)
* LC_COLLATE: Bash Variables. (line 560)
* LC_CTYPE: Bash Variables. (line 567)
* LANG <1>: Bash Variables. (line 553)
* LC_ALL: Bash Variables. (line 557)
* LC_COLLATE: Bash Variables. (line 561)
* LC_CTYPE: Bash Variables. (line 568)
* LC_MESSAGES: Creating Internationalized Scripts.
(line 51)
* LC_MESSAGES <1>: Bash Variables. (line 572)
* LC_NUMERIC: Bash Variables. (line 576)
* LC_TIME: Bash Variables. (line 580)
* LINENO: Bash Variables. (line 584)
* LINES: Bash Variables. (line 591)
* MACHTYPE: Bash Variables. (line 597)
* LC_MESSAGES <1>: Bash Variables. (line 573)
* LC_NUMERIC: Bash Variables. (line 577)
* LC_TIME: Bash Variables. (line 581)
* LINENO: Bash Variables. (line 585)
* LINES: Bash Variables. (line 592)
* MACHTYPE: Bash Variables. (line 598)
* MAIL: Bourne Shell Variables.
(line 24)
* MAILCHECK: Bash Variables. (line 601)
* MAILCHECK: Bash Variables. (line 602)
* MAILPATH: Bourne Shell Variables.
(line 29)
* MAPFILE: Bash Variables. (line 609)
* MAPFILE: Bash Variables. (line 610)
* mark-modified-lines: Readline Init File Syntax.
(line 306)
* mark-symlinked-directories: Readline Init File Syntax.
@@ -13058,46 +13090,46 @@ D.3 Parameter and Variable Index
(line 323)
* meta-flag: Readline Init File Syntax.
(line 258)
* OLDPWD: Bash Variables. (line 613)
* OLDPWD: Bash Variables. (line 614)
* OPTARG: Bourne Shell Variables.
(line 36)
* OPTERR: Bash Variables. (line 616)
* OPTERR: Bash Variables. (line 617)
* OPTIND: Bourne Shell Variables.
(line 40)
* OSTYPE: Bash Variables. (line 621)
* OSTYPE: Bash Variables. (line 622)
* output-meta: Readline Init File Syntax.
(line 328)
* page-completions: Readline Init File Syntax.
(line 337)
* PATH: Bourne Shell Variables.
(line 44)
* PIPESTATUS: Bash Variables. (line 624)
* POSIXLY_CORRECT: Bash Variables. (line 634)
* PPID: Bash Variables. (line 644)
* PROMPT_COMMAND: Bash Variables. (line 648)
* PROMPT_DIRTRIM: Bash Variables. (line 654)
* PS0: Bash Variables. (line 660)
* PIPESTATUS: Bash Variables. (line 625)
* POSIXLY_CORRECT: Bash Variables. (line 635)
* PPID: Bash Variables. (line 645)
* PROMPT_COMMAND: Bash Variables. (line 649)
* PROMPT_DIRTRIM: Bash Variables. (line 655)
* PS0: Bash Variables. (line 661)
* PS1: Bourne Shell Variables.
(line 53)
* PS2: Bourne Shell Variables.
(line 58)
* PS3: Bash Variables. (line 665)
* PS4: Bash Variables. (line 670)
* PWD: Bash Variables. (line 678)
* RANDOM: Bash Variables. (line 681)
* READLINE_ARGUMENT: Bash Variables. (line 689)
* READLINE_LINE: Bash Variables. (line 693)
* READLINE_MARK: Bash Variables. (line 697)
* READLINE_POINT: Bash Variables. (line 703)
* REPLY: Bash Variables. (line 707)
* PS3: Bash Variables. (line 666)
* PS4: Bash Variables. (line 671)
* PWD: Bash Variables. (line 679)
* RANDOM: Bash Variables. (line 682)
* READLINE_ARGUMENT: Bash Variables. (line 690)
* READLINE_LINE: Bash Variables. (line 694)
* READLINE_MARK: Bash Variables. (line 698)
* READLINE_POINT: Bash Variables. (line 704)
* REPLY: Bash Variables. (line 708)
* revert-all-at-newline: Readline Init File Syntax.
(line 350)
* search-ignore-case: Readline Init File Syntax.
(line 357)
* SECONDS: Bash Variables. (line 711)
* SHELL: Bash Variables. (line 721)
* SHELLOPTS: Bash Variables. (line 726)
* SHLVL: Bash Variables. (line 735)
* SECONDS: Bash Variables. (line 712)
* SHELL: Bash Variables. (line 722)
* SHELLOPTS: Bash Variables. (line 727)
* SHLVL: Bash Variables. (line 737)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 362)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -13106,15 +13138,15 @@ D.3 Parameter and Variable Index
(line 377)
* skip-completed-text: Readline Init File Syntax.
(line 383)
* SRANDOM: Bash Variables. (line 740)
* SRANDOM: Bash Variables. (line 742)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 749)
* TMOUT: Bash Variables. (line 788)
* TMPDIR: Bash Variables. (line 800)
* UID: Bash Variables. (line 804)
* TIMEFORMAT: Bash Variables. (line 751)
* TMOUT: Bash Variables. (line 790)
* TMPDIR: Bash Variables. (line 802)
* UID: Bash Variables. (line 806)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 396)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -13136,7 +13168,7 @@ D.4 Function Index
* accept-line (Newline or Return): Commands For History.
(line 6)
* alias-expand-line (): Miscellaneous Commands.
(line 133)
(line 134)
* backward-char (C-b): Commands For Moving. (line 18)
* backward-delete-char (Rubout): Commands For Text. (line 18)
* backward-kill-line (C-x Rubout): Commands For Killing.
@@ -13185,7 +13217,7 @@ D.4 Function Index
(line 50)
* digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6)
* display-shell-version (C-x C-v): Miscellaneous Commands.
(line 147)
(line 148)
* do-lowercase-version (M-A, M-B, M-X, ...): Miscellaneous Commands.
(line 14)
* downcase-word (M-l): Commands For Text. (line 69)
@@ -13198,7 +13230,7 @@ D.4 Function Index
* dynamic-complete-history (M-<TAB>): Commands For Completion.
(line 115)
* edit-and-execute-command (C-x C-e): Miscellaneous Commands.
(line 142)
(line 143)
* end-kbd-macro (C-x )): Keyboard Macros. (line 9)
* end-of-file (usually C-d): Commands For Text. (line 6)
* end-of-history (M->): Commands For History.
@@ -13224,9 +13256,9 @@ D.4 Function Index
* glob-list-expansions (C-x g): Miscellaneous Commands.
(line 114)
* history-and-alias-expand-line (): Miscellaneous Commands.
(line 136)
(line 137)
* history-expand-line (M-^): Miscellaneous Commands.
(line 126)
(line 127)
* history-search-backward (): Commands For History.
(line 53)
* history-search-forward (): Commands For History.
@@ -13240,7 +13272,7 @@ D.4 Function Index
* insert-completions (M-*): Commands For Completion.
(line 24)
* insert-last-argument (M-. or M-_): Miscellaneous Commands.
(line 139)
(line 140)
* kill-line (C-k): Commands For Killing.
(line 6)
* kill-region (): Commands For Killing.
@@ -13250,7 +13282,7 @@ D.4 Function Index
* kill-word (M-d): Commands For Killing.
(line 23)
* magic-space (): Miscellaneous Commands.
(line 129)
(line 130)
* menu-complete (): Commands For Completion.
(line 28)
* menu-complete-backward (): Commands For Completion.
@@ -13430,7 +13462,7 @@ D.5 Concept Index
* installation: Basic Installation. (line 6)
* interaction, readline: Readline Interaction.
(line 6)
* interactive shell: Invoking Bash. (line 136)
* interactive shell: Invoking Bash. (line 137)
* interactive shell <1>: Interactive Shells. (line 6)
* internationalization: Locale Translation. (line 6)
* internationalized scripts: Creating Internationalized Scripts.
@@ -13443,7 +13475,7 @@ D.5 Concept Index
* killing text: Readline Killing Commands.
(line 6)
* localization: Locale Translation. (line 6)
* login shell: Invoking Bash. (line 133)
* login shell: Invoking Bash. (line 134)
* matching, pattern: Pattern Matching. (line 6)
* metacharacter: Definitions. (line 50)
* name: Definitions. (line 55)
@@ -13509,138 +13541,138 @@ D.5 Concept Index

Tag Table:
Node: Top901
Node: Introduction2842
Node: What is Bash?3055
Node: What is a shell?4188
Node: Definitions6798
Node: Basic Shell Features10125
Node: Shell Syntax11349
Node: Shell Operation12376
Node: Quoting13667
Node: Escape Character15005
Node: Single Quotes15540
Node: Double Quotes15889
Node: ANSI-C Quoting17234
Node: Locale Translation18628
Node: Creating Internationalized Scripts20031
Node: Comments24229
Node: Shell Commands24996
Node: Reserved Words25935
Node: Simple Commands26800
Node: Pipelines27462
Node: Lists30718
Node: Compound Commands32590
Node: Looping Constructs33599
Node: Conditional Constructs36118
Node: Command Grouping51054
Node: Coprocesses52546
Node: GNU Parallel55232
Node: Shell Functions56150
Node: Shell Parameters64602
Node: Positional Parameters69327
Node: Special Parameters70417
Node: Shell Expansions73878
Node: Brace Expansion76067
Node: Tilde Expansion78768
Node: Shell Parameter Expansion81723
Node: Command Substitution101483
Node: Arithmetic Expansion105012
Node: Process Substitution106025
Node: Word Splitting107133
Node: Filename Expansion109577
Node: Pattern Matching112840
Node: Quote Removal118563
Node: Redirections118867
Node: Executing Commands129095
Node: Simple Command Expansion129762
Node: Command Search and Execution131870
Node: Command Execution Environment134314
Node: Environment137762
Node: Exit Status139665
Node: Signals141723
Node: Shell Scripts146652
Node: Shell Builtin Commands149950
Node: Bourne Shell Builtins152061
Node: Bash Builtins178626
Node: Modifying Shell Behavior215074
Node: The Set Builtin215416
Node: The Shopt Builtin227370
Node: Special Builtins244422
Node: Shell Variables245411
Node: Bourne Shell Variables245845
Node: Bash Variables248353
Node: Bash Features287048
Node: Invoking Bash288062
Node: Bash Startup Files294488
Node: Interactive Shells299730
Node: What is an Interactive Shell?300138
Node: Is this Shell Interactive?300800
Node: Interactive Shell Behavior301624
Node: Bash Conditional Expressions305385
Node: Shell Arithmetic310596
Node: Aliases313925
Node: Arrays317059
Node: The Directory Stack324143
Node: Directory Stack Builtins324940
Node: Controlling the Prompt329385
Node: The Restricted Shell332270
Node: Bash POSIX Mode335152
Node: Shell Compatibility Mode353214
Node: Job Control362221
Node: Job Control Basics362678
Node: Job Control Builtins368956
Node: Job Control Variables375638
Node: Command Line Editing376869
Node: Introduction and Notation378572
Node: Readline Interaction380924
Node: Readline Bare Essentials382112
Node: Readline Movement Commands383920
Node: Readline Killing Commands384916
Node: Readline Arguments386939
Node: Searching387996
Node: Readline Init File390239
Node: Readline Init File Syntax391542
Node: Conditional Init Constructs418372
Node: Sample Init File422757
Node: Bindable Readline Commands425878
Node: Commands For Moving427416
Node: Commands For History429784
Node: Commands For Text435174
Node: Commands For Killing439299
Node: Numeric Arguments442087
Node: Commands For Completion443239
Node: Keyboard Macros448935
Node: Miscellaneous Commands449636
Node: Readline vi Mode456196
Node: Programmable Completion457173
Node: Programmable Completion Builtins465910
Node: A Programmable Completion Example477647
Node: Using History Interactively482992
Node: Bash History Facilities483673
Node: Bash History Builtins487408
Node: History Interaction493879
Node: Event Designators498829
Node: Word Designators500407
Node: Modifiers502711
Node: Installing Bash504648
Node: Basic Installation505764
Node: Compilers and Options509640
Node: Compiling For Multiple Architectures510390
Node: Installation Names512143
Node: Specifying the System Type514377
Node: Sharing Defaults515123
Node: Operation Controls515837
Node: Optional Features516856
Node: Reporting Bugs529236
Node: Major Differences From The Bourne Shell530594
Node: GNU Free Documentation License552014
Node: Indexes577191
Node: Builtin Index577642
Node: Reserved Word Index584740
Node: Variable Index587185
Node: Function Index604598
Node: Concept Index618593
Node: Top897
Node: Introduction2834
Node: What is Bash?3047
Node: What is a shell?4180
Node: Definitions6790
Node: Basic Shell Features10117
Node: Shell Syntax11341
Node: Shell Operation12368
Node: Quoting13659
Node: Escape Character14997
Node: Single Quotes15532
Node: Double Quotes15881
Node: ANSI-C Quoting17226
Node: Locale Translation18620
Node: Creating Internationalized Scripts20023
Node: Comments24221
Node: Shell Commands24988
Node: Reserved Words25927
Node: Simple Commands26792
Node: Pipelines27454
Node: Lists30710
Node: Compound Commands32582
Node: Looping Constructs33591
Node: Conditional Constructs36110
Node: Command Grouping51046
Node: Coprocesses52538
Node: GNU Parallel55224
Node: Shell Functions56142
Node: Shell Parameters64590
Node: Positional Parameters69492
Node: Special Parameters70582
Node: Shell Expansions74043
Node: Brace Expansion76232
Node: Tilde Expansion79578
Node: Shell Parameter Expansion82533
Node: Command Substitution102293
Node: Arithmetic Expansion105822
Node: Process Substitution106836
Node: Word Splitting107944
Node: Filename Expansion110388
Node: Pattern Matching113612
Node: Quote Removal119335
Node: Redirections119639
Node: Executing Commands129902
Node: Simple Command Expansion130569
Node: Command Search and Execution132677
Node: Command Execution Environment135121
Node: Environment138569
Node: Exit Status140472
Node: Signals142530
Node: Shell Scripts147459
Node: Shell Builtin Commands150757
Node: Bourne Shell Builtins152868
Node: Bash Builtins179432
Node: Modifying Shell Behavior216356
Node: The Set Builtin216698
Node: The Shopt Builtin228686
Node: Special Builtins245738
Node: Shell Variables246727
Node: Bourne Shell Variables247161
Node: Bash Variables249669
Node: Bash Features288488
Node: Invoking Bash289502
Node: Bash Startup Files296086
Node: Interactive Shells301328
Node: What is an Interactive Shell?301736
Node: Is this Shell Interactive?302398
Node: Interactive Shell Behavior303222
Node: Bash Conditional Expressions306983
Node: Shell Arithmetic312194
Node: Aliases315523
Node: Arrays318657
Node: The Directory Stack325749
Node: Directory Stack Builtins326546
Node: Controlling the Prompt330991
Node: The Restricted Shell333876
Node: Bash POSIX Mode336758
Node: Shell Compatibility Mode354819
Node: Job Control363826
Node: Job Control Basics364283
Node: Job Control Builtins370561
Node: Job Control Variables377243
Node: Command Line Editing378474
Node: Introduction and Notation380177
Node: Readline Interaction382529
Node: Readline Bare Essentials383717
Node: Readline Movement Commands385525
Node: Readline Killing Commands386521
Node: Readline Arguments388544
Node: Searching389601
Node: Readline Init File391844
Node: Readline Init File Syntax393147
Node: Conditional Init Constructs419972
Node: Sample Init File424357
Node: Bindable Readline Commands427477
Node: Commands For Moving429015
Node: Commands For History431383
Node: Commands For Text436773
Node: Commands For Killing440898
Node: Numeric Arguments443686
Node: Commands For Completion444838
Node: Keyboard Macros450534
Node: Miscellaneous Commands451235
Node: Readline vi Mode457802
Node: Programmable Completion458779
Node: Programmable Completion Builtins467516
Node: A Programmable Completion Example479253
Node: Using History Interactively484598
Node: Bash History Facilities485279
Node: Bash History Builtins489014
Node: History Interaction495485
Node: Event Designators500435
Node: Word Designators502013
Node: Modifiers504317
Node: Installing Bash506254
Node: Basic Installation507370
Node: Compilers and Options511246
Node: Compiling For Multiple Architectures511996
Node: Installation Names513749
Node: Specifying the System Type515983
Node: Sharing Defaults516729
Node: Operation Controls517443
Node: Optional Features518462
Node: Reporting Bugs530842
Node: Major Differences From The Bourne Shell532199
Node: GNU Free Documentation License553619
Node: Indexes578796
Node: Builtin Index579247
Node: Reserved Word Index586345
Node: Variable Index588790
Node: Function Index606203
Node: Concept Index620198

End Tag Table
BIN
View File
Binary file not shown.
+6 -6
View File
@@ -105,15 +105,15 @@
@xrdef{Process Substitution-title}{Process Substitution}
@xrdef{Process Substitution-snt}{Section@tie 3.5.6}
@xrdef{Arithmetic Expansion-pg}{36}
@xrdef{Process Substitution-pg}{36}
@xrdef{Word Splitting-title}{Word Splitting}
@xrdef{Word Splitting-snt}{Section@tie 3.5.7}
@xrdef{Process Substitution-pg}{37}
@xrdef{Word Splitting-pg}{37}
@xrdef{Filename Expansion-title}{Filename Expansion}
@xrdef{Filename Expansion-snt}{Section@tie 3.5.8}
@xrdef{Word Splitting-pg}{37}
@xrdef{Filename Expansion-pg}{37}
@xrdef{Pattern Matching-title}{Pattern Matching}
@xrdef{Pattern Matching-snt}{Section@tie 3.5.8.1}
@xrdef{Filename Expansion-pg}{38}
@xrdef{Pattern Matching-pg}{38}
@xrdef{Quote Removal-title}{Quote Removal}
@xrdef{Quote Removal-snt}{Section@tie 3.5.9}
@@ -135,9 +135,9 @@
@xrdef{Command Execution Environment-pg}{45}
@xrdef{Environment-title}{Environment}
@xrdef{Environment-snt}{Section@tie 3.7.4}
@xrdef{Environment-pg}{46}
@xrdef{Exit Status-title}{Exit Status}
@xrdef{Exit Status-snt}{Section@tie 3.7.5}
@xrdef{Environment-pg}{47}
@xrdef{Exit Status-pg}{47}
@xrdef{Signals-title}{Signals}
@xrdef{Signals-snt}{Section@tie 3.7.6}
@@ -159,13 +159,13 @@
@xrdef{The Set Builtin-title}{The Set Builtin}
@xrdef{The Set Builtin-snt}{Section@tie 4.3.1}
@xrdef{Modifying Shell Behavior-pg}{72}
@xrdef{The Set Builtin-pg}{72}
@xrdef{The Set Builtin-pg}{73}
@xrdef{The Shopt Builtin-title}{The Shopt Builtin}
@xrdef{The Shopt Builtin-snt}{Section@tie 4.3.2}
@xrdef{The Shopt Builtin-pg}{77}
@xrdef{Special Builtins-title}{Special Builtins}
@xrdef{Special Builtins-snt}{Section@tie 4.4}
@xrdef{Special Builtins-pg}{83}
@xrdef{Special Builtins-pg}{84}
@xrdef{Shell Variables-title}{Shell Variables}
@xrdef{Shell Variables-snt}{Chapter@tie 5}
@xrdef{Bourne Shell Variables-title}{Bourne Shell Variables}
+2 -2
View File
@@ -32,7 +32,7 @@
\entry{help}{66}{\code {help}}
\entry{let}{66}{\code {let}}
\entry{local}{66}{\code {local}}
\entry{logout}{66}{\code {logout}}
\entry{logout}{67}{\code {logout}}
\entry{mapfile}{67}{\code {mapfile}}
\entry{printf}{67}{\code {printf}}
\entry{read}{68}{\code {read}}
@@ -42,7 +42,7 @@
\entry{typeset}{71}{\code {typeset}}
\entry{ulimit}{71}{\code {ulimit}}
\entry{unalias}{72}{\code {unalias}}
\entry{set}{72}{\code {set}}
\entry{set}{73}{\code {set}}
\entry{shopt}{77}{\code {shopt}}
\entry{dirs}{111}{\code {dirs}}
\entry{popd}{111}{\code {popd}}
+2 -2
View File
@@ -47,7 +47,7 @@
\initial {L}
\entry{\code {let}}{66}
\entry{\code {local}}{66}
\entry{\code {logout}}{66}
\entry{\code {logout}}{67}
\initial {M}
\entry{\code {mapfile}}{67}
\initial {P}
@@ -61,7 +61,7 @@
\entry{\code {readonly}}{55}
\entry{\code {return}}{56}
\initial {S}
\entry{\code {set}}{72}
\entry{\code {set}}{73}
\entry{\code {shift}}{56}
\entry{\code {shopt}}{77}
\entry{\code {source}}{70}
+7 -7
View File
@@ -58,12 +58,12 @@
\entry{command substitution}{35}{command substitution}
\entry{expansion, arithmetic}{36}{expansion, arithmetic}
\entry{arithmetic expansion}{36}{arithmetic expansion}
\entry{process substitution}{36}{process substitution}
\entry{process substitution}{37}{process substitution}
\entry{word splitting}{37}{word splitting}
\entry{expansion, filename}{37}{expansion, filename}
\entry{expansion, pathname}{37}{expansion, pathname}
\entry{filename expansion}{37}{filename expansion}
\entry{pathname expansion}{37}{pathname expansion}
\entry{expansion, filename}{38}{expansion, filename}
\entry{expansion, pathname}{38}{expansion, pathname}
\entry{filename expansion}{38}{filename expansion}
\entry{pathname expansion}{38}{pathname expansion}
\entry{pattern matching}{38}{pattern matching}
\entry{matching, pattern}{38}{matching, pattern}
\entry{redirection}{40}{redirection}
@@ -71,11 +71,11 @@
\entry{command execution}{45}{command execution}
\entry{command search}{45}{command search}
\entry{execution environment}{45}{execution environment}
\entry{environment}{46}{environment}
\entry{environment}{47}{environment}
\entry{exit status}{47}{exit status}
\entry{signal handling}{48}{signal handling}
\entry{shell script}{49}{shell script}
\entry{special builtin}{83}{special builtin}
\entry{special builtin}{84}{special builtin}
\entry{login shell}{101}{login shell}
\entry{interactive shell}{101}{interactive shell}
\entry{startup files}{101}{startup files}
+7 -7
View File
@@ -43,7 +43,7 @@
\entry{dollar-single quote quoting}{6}
\initial {E}
\entry{editing command lines}{129}
\entry{environment}{46}
\entry{environment}{47}
\entry{evaluation, arithmetic}{106}
\entry{event designators}{170}
\entry{execution environment}{45}
@@ -51,16 +51,16 @@
\entry{expansion}{24}
\entry{expansion, arithmetic}{36}
\entry{expansion, brace}{25}
\entry{expansion, filename}{37}
\entry{expansion, filename}{38}
\entry{expansion, parameter}{27}
\entry{expansion, pathname}{37}
\entry{expansion, pathname}{38}
\entry{expansion, tilde}{26}
\entry{expressions, arithmetic}{106}
\entry{expressions, conditional}{104}
\initial {F}
\entry{field}{3}
\entry{filename}{3}
\entry{filename expansion}{37}
\entry{filename expansion}{38}
\entry{foreground}{123}
\entry{functions, shell}{19}
\initial {H}
@@ -100,7 +100,7 @@
\entry{parameters}{22}
\entry{parameters, positional}{23}
\entry{parameters, special}{23}
\entry{pathname expansion}{37}
\entry{pathname expansion}{38}
\entry{pattern matching}{38}
\entry{pipeline}{10}
\entry{POSIX}{3}
@@ -108,7 +108,7 @@
\entry{POSIX Mode}{115}
\entry{process group}{3}
\entry{process group ID}{3}
\entry{process substitution}{36}
\entry{process substitution}{37}
\entry{programmable completion}{156}
\entry{prompting}{112}
\initial {Q}
@@ -129,7 +129,7 @@
\entry{shell, interactive}{103}
\entry{signal}{4}
\entry{signal handling}{48}
\entry{special builtin}{4, 83}
\entry{special builtin}{4, 84}
\entry{startup files}{101}
\entry{string translations}{8}
\entry{suspending jobs}{123}
+252 -131
View File
@@ -4,13 +4,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This text is a brief description of the features that are present in
the Bash shell (version 5.3, 12 December 2024).
the Bash shell (version 5.3, 8 January 2025).
This is Edition 5.3, last updated 12 December 2024,
This is Edition 5.3, last updated 8 January 2025,
of The GNU Bash Reference Manual,
for Bash, Version 5.3.
Copyright © 1988-2024 Free Software Foundation, Inc.
Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -77,10 +77,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
<h1 class="top" id="Bash-Features-1"><span>Bash Features<a class="copiable-link" href="#Bash-Features-1"> &para;</a></span></h1>
<p>This text is a brief description of the features that are present in
the Bash shell (version 5.3, 12 December 2024).
the Bash shell (version 5.3, 8 January 2025).
The Bash home page is <a class="url" href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
</p>
<p>This is Edition 5.3, last updated 12 December 2024,
<p>This is Edition 5.3, last updated 8 January 2025,
of <cite class="cite">The GNU Bash Reference Manual</cite>,
for <code class="code">Bash</code>, Version 5.3.
</p>
@@ -2072,7 +2072,7 @@ until it is reset in that scope or until the function returns.
Once the function returns, any instance of the variable at a previous
scope becomes visible.
If the unset acts on a variable at a previous scope, any instance of a
variable with that name that had been shadowed will become visible
variable with that name that had been shadowed becomes visible
(see below how the <code class="code">localvar_unset</code> shell option changes this behavior).
</p>
<p>The <samp class="option">-f</samp> option to the <code class="code">declare</code> (<code class="code">typeset</code>)
@@ -2150,23 +2150,26 @@ For example,
</pre></div>
<p>In the context where an assignment statement is assigning a value
to a shell variable or array index (see <a class="pxref" href="#Arrays">Arrays</a>),
the &lsquo;<samp class="samp">+=</samp>&rsquo; operator appends to or adds to
to a shell variable or array index (see <a class="pxref" href="#Arrays">Arrays</a>), the
&lsquo;<samp class="samp">+=</samp>&rsquo; operator appends to or adds to
the variable&rsquo;s previous value.
This includes arguments to declaration commands such as
<code class="code">declare</code> that accept assignment statements.
When &lsquo;<samp class="samp">+=</samp>&rsquo; is applied to a variable
for which the <code class="code">integer</code> attribute has been set,
<code class="code">declare</code>
that accept assignment statements.
When &lsquo;<samp class="samp">+=</samp>&rsquo;
is applied to a variable for which the
<code class="code">integer</code> attribute has been set,
the variable&rsquo;s current value and <var class="var">value</var> are each evaluated as
arithmetic expressions,
and the sum of the results is assigned as the variable&rsquo;s value.
The current value is usually an integer constant, but may be an expression.
When &lsquo;<samp class="samp">+=</samp>&rsquo; is applied to an array variable using compound assignment
(see <a class="pxref" href="#Arrays">Arrays</a>), the
variable&rsquo;s value is not unset (as it is when using &lsquo;<samp class="samp">=</samp>&rsquo;), and new
values are appended to the array beginning at one greater than the array&rsquo;s
maximum index (for indexed arrays), or added as additional key-value pairs
in an associative array.
When &lsquo;<samp class="samp">+=</samp>&rsquo;
is applied to an array variable using compound assignment (see <a class="pxref" href="#Arrays">Arrays</a>),
the variable&rsquo;s value is not unset
(as it is when using &lsquo;<samp class="samp">=</samp>&rsquo;),
and new values are appended to the array
beginning at one greater than the array&rsquo;s maximum index (for indexed arrays),
or added as additional key-value pairs in an associative array.
When applied to a string-valued variable, <var class="var">value</var> is expanded and
appended to the variable&rsquo;s value.
</p>
@@ -2205,6 +2208,10 @@ Namerefs can be unset using the <samp class="option">-n</samp> option to the <co
Otherwise, if <code class="code">unset</code> is executed with the name of a nameref variable
as an argument, the variable referenced by the nameref variable is unset.
</p>
<p>When the shell starts, it reads its environment and creates a shell
variable from each environment variable that has a valid name,
as described below (see <a class="pxref" href="#Environment">Environment</a>).
</p>
<ul class="mini-toc">
<li><a href="#Positional-Parameters" accesskey="1">Positional Parameters</a></li>
<li><a href="#Special-Parameters" accesskey="2">Special Parameters</a></li>
@@ -2425,12 +2432,13 @@ This mechanism is similar to
<em class="dfn">filename expansion</em> (see <a class="pxref" href="#Filename-Expansion">Filename Expansion</a>),
but the filenames generated need not exist.
Patterns to be brace expanded are formed from an optional <var class="var">preamble</var>,
followed by either a series of comma-separated strings or a sequence expression
between a pair of braces,
followed by an optional <var class="var">postscript</var>.
The preamble is prefixed to each string contained within the braces, and
the postscript is then appended to each resulting string, expanding left
to right.
followed by either a series of comma-separated strings or
a sequence expression between a pair of braces,
followed by an optional
<var class="var">postscript</var>.
The preamble is prefixed to each string contained within the braces,
and the postscript is then appended to each resulting string,
expanding left to right.
</p>
<p>Brace expansions may be nested.
The results of each expanded string are not sorted;
@@ -2441,7 +2449,8 @@ For example,
ade ace abe
</pre></div>
<p>A sequence expression takes the form <code class="code">{<var class="var">x</var>..<var class="var">y</var>[..<var class="var">incr</var>]}</code>,
<p>A sequence expression takes the form
<code class="code">{<var class="var">x</var>..<var class="var">y</var>[..<var class="var">incr</var>]}</code>,
where <var class="var">x</var> and <var class="var">y</var> are either integers or letters,
and <var class="var">incr</var>, an optional increment, is an integer.
When integers are supplied, the expression expands to each number between
@@ -2470,11 +2479,13 @@ and closing braces, and at least one unquoted comma or a valid
sequence expression.
Any incorrectly formed brace expansion is left unchanged.
</p>
<p>A { or &lsquo;<samp class="samp">,</samp>&rsquo; may be quoted with a backslash to prevent its
<p>A &lsquo;<samp class="samp">{</samp>&rsquo; or &lsquo;<samp class="samp">,</samp>&rsquo;
may be quoted with a backslash to prevent its
being considered part of a brace expression.
To avoid conflicts with parameter expansion, the string &lsquo;<samp class="samp">${</samp>&rsquo;
is not considered eligible for brace expansion,
and inhibits brace expansion until the closing &lsquo;<samp class="samp">}</samp>&rsquo;.
and inhibits brace expansion until the closing
&lsquo;<samp class="samp">}</samp>&rsquo;.
</p>
<p>This construct is typically used as shorthand when the common
prefix of the strings to be generated is longer than in the
@@ -2487,6 +2498,38 @@ above example:
<pre class="example-preformatted">chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
</pre></div>
<p>Brace expansion introduces a slight incompatibility with
historical versions of
<code class="command">sh</code>.
<code class="command">sh</code>
does not treat opening or closing braces specially when they
appear as part of a word, and preserves them in the output.
Bash
removes braces from words as a consequence of brace
expansion.
For example, a word entered to
<code class="command">sh</code>
as
&lsquo;<samp class="samp">file{1,2}</samp>&rsquo;
appears identically in the output.
Bash
outputs that word as
&lsquo;<samp class="samp">file1 file2</samp>&rsquo;
after brace expansion.
Start
Bash
with the
<samp class="option">+B</samp>
option or disable brace expansion with the
<samp class="option">+B</samp>
option to the
<code class="code">set</code>
command
(see <a class="pxref" href="#Shell-Builtin-Commands">Shell Builtin Commands</a>)
for strict
<code class="command">sh</code>
compatibility.
</p>
<hr>
</div>
<div class="subsection-level-extent" id="Tilde-Expansion">
@@ -3259,7 +3302,7 @@ Next: <a href="#Process-Substitution" accesskey="n" rel="next">Process Substitut
<a class="index-entry-id" id="index-expansion_002c-arithmetic"></a>
<a class="index-entry-id" id="index-arithmetic-expansion"></a>
<p>Arithmetic expansion evalutes an arithmetic expression
<p>Arithmetic expansion evaluates an arithmetic expression
and substitutes the result.
The format for arithmetic expansion is:
</p>
@@ -3309,8 +3352,9 @@ This filename is
passed as an argument to the current command as the result of the
expansion.
</p>
<p>If the <code class="code">&gt;(<var class="var">list</var>)</code> form is used, writing to
the file provides input for <var class="var">list</var>.
<p>If the
<code class="code">&gt;(<var class="var">list</var>)</code> form is used, writing to the file
provides input for <var class="var">list</var>.
If the
<code class="code">&lt;(<var class="var">list</var>)</code> form is used, reading the file
obtains the output of <var class="var">list</var>.
@@ -3452,23 +3496,25 @@ The filenames
<samp class="file">.</samp> and <samp class="file">..</samp>
are always ignored when <code class="env">GLOBIGNORE</code>
is set and not null.
However, setting <code class="env">GLOBIGNORE</code> to a non-null value has the effect of
enabling the <code class="code">dotglob</code>
However, setting <code class="env">GLOBIGNORE</code>
to a non-null value has the effect of enabling the
<code class="code">dotglob</code>
shell option, so all other filenames beginning with a
&lsquo;<samp class="samp">.</samp>&rsquo;
match.
To get the old behavior of ignoring filenames beginning with a
&lsquo;<samp class="samp">.</samp>&rsquo;, make &lsquo;<samp class="samp">.*</samp>&rsquo; one of the patterns in <code class="env">GLOBIGNORE</code>.
&lsquo;<samp class="samp">.</samp>&rsquo;,
make &lsquo;<samp class="samp">.*</samp>&rsquo; one of the patterns in <code class="env">GLOBIGNORE</code>.
The <code class="code">dotglob</code> option is disabled when <code class="env">GLOBIGNORE</code>
is unset.
The <code class="code">GLOBIGNORE</code>
pattern matching honors the setting of the <code class="code">extglob</code> shell
option.
</p>
<p>After the pattern is expanded and matched against filenames, the value of the
<code class="env">GLOBSORT</code> shell
variable controls how the results are sorted, as described
below (see <a class="pxref" href="#Bash-Variables">Bash Variables</a>).
<p>The value of the
<code class="env">GLOBSORT</code>
shell variable controls how the results of pathname expansion are sorted,
as described below (see <a class="pxref" href="#Bash-Variables">Bash Variables</a>).
</p>
<ul class="mini-toc">
<li><a href="#Pattern-Matching" accesskey="1">Pattern Matching</a></li>
@@ -3539,7 +3585,9 @@ force the use of the C locale by setting the <code class="env">LC_COLLATE</code>
<p>Within a bracket expression, <em class="dfn">character classes</em> can be specified
using the syntax
<code class="code">[:</code><var class="var">class</var><code class="code">:]</code>, where <var class="var">class</var> is one of the
following classes defined in the <small class="sc">POSIX</small> standard:
following classes defined in the
<small class="sc">POSIX</small>
standard:
</p><div class="example">
<pre class="example-preformatted">alnum alpha ascii blank cntrl digit graph lower
print punct space upper word xdigit
@@ -3807,19 +3855,22 @@ and the
<code class="code">noclobber</code>
option to the
<code class="code">set</code>
builtin has been enabled, the redirection fails if the file
builtin command has been enabled, the redirection fails if the file
whose name results from the expansion of <var class="var">word</var> exists and is
a regular file.
If the redirection operator is &lsquo;<samp class="samp">&gt;|</samp>&rsquo;, or the redirection operator is
&lsquo;<samp class="samp">&gt;</samp>&rsquo; and the <code class="code">noclobber</code> option is not enabled,
Bash attemps the redirection
If the redirection operator is &lsquo;<samp class="samp">&gt;|</samp>&rsquo;,
or the redirection operator is &lsquo;<samp class="samp">&gt;</samp>&rsquo; and
the <code class="code">noclobber</code> option to the <code class="code">set</code>
builtin is not enabled,
Bash attempts the redirection
even if the file named by <var class="var">word</var> exists.
</p>
</div>
<div class="subsection-level-extent" id="Appending-Redirected-Output">
<h4 class="subsection"><span>3.6.3 Appending Redirected Output<a class="copiable-link" href="#Appending-Redirected-Output"> &para;</a></span></h4>
<p>Redirecting output in this fashion opens
the file whose name results from the expansion of <var class="var">word</var>
the file whose name results from the expansion of
<var class="var">word</var>
for appending on file descriptor <var class="var">n</var>,
or the standard output (file descriptor 1) if <var class="var">n</var>
is not specified.
@@ -5122,7 +5173,9 @@ commands sort lexicographically using ASCII ordering.
</p>
<p>The historical operator-precedence parsing with 4 or more arguments can
lead to ambiguities when it encounters strings that look like primaries.
The <small class="sc">POSIX</small> standard has deprecated the <samp class="option">-a</samp> and <samp class="option">-o</samp>
The
<small class="sc">POSIX</small>
standard has deprecated the <samp class="option">-a</samp> and <samp class="option">-o</samp>
primaries and enclosing expressions within parentheses.
Scripts should no longer use them.
It&rsquo;s much more reliable to restrict test invocations to a single primary,
@@ -5158,7 +5211,7 @@ The return status is zero.
shell receives any of the signals <var class="var">sigspec</var>.
If <var class="var">action</var> is absent (and
there is a single <var class="var">sigspec</var>) or
equal to &lsquo;<samp class="samp">-</samp>&rsquo;, each specified <var class="var">sigspec</var>&rsquo;ss disposition is reset
equal to &lsquo;<samp class="samp">-</samp>&rsquo;, each specified <var class="var">sigspec</var>&rsquo;s disposition is reset
to the value it had when the shell was started.
If <var class="var">action</var> is the null string, then the signal specified by
each <var class="var">sigspec</var> is ignored by the shell and commands it invokes.
@@ -5439,7 +5492,7 @@ If the separator is a colon, any enclosing double quotes are optional, and
Readline does not expand the command string before saving it.
Since the entire key binding expression must be a single argument, it
should be enclosed in single quotes.
When <var class="var">shell-command</var> is executed, the shell sets thex
When <var class="var">shell-command</var> is executed, the shell sets the
<code class="code">READLINE_LINE</code> variable to the contents of the Readline line
buffer
and the
@@ -5751,7 +5804,9 @@ The <samp class="option">-n</samp> option means to print only disabled builtins.
The <samp class="option">-a</samp> option means to list
each builtin with an indication of whether or not it is enabled.
The <samp class="option">-s</samp> option means to
restrict <code class="code">enable</code> to the <small class="sc">POSIX</small> special builtins.
restrict <code class="code">enable</code> to the
<small class="sc">POSIX</small>
special builtins.
</p>
<p>The <samp class="option">-f</samp> option means to load the new builtin command <var class="var">name</var>
from shared object <var class="var">filename</var>, on systems that support dynamic loading.
@@ -5761,8 +5816,9 @@ colon-separated list of directories in which to search for <var class="var">file
The default for <code class="env">BASH_LOADABLES_PATH</code> is system-dependent,
and may include &quot;.&quot; to force a search of the current directory.
The <samp class="option">-d</samp> option will delete a builtin loaded with <samp class="option">-f</samp>.
If <samp class="option">-s</samp> is used with <samp class="option">-f</samp>, the new builtin becomes
a special builtin (see <a class="pxref" href="#Special-Builtins">Special Builtins</a>).
If <samp class="option">-s</samp> is used with <samp class="option">-f</samp>, the new builtin becomes a
<small class="sc">POSIX</small>
special builtin (see <a class="pxref" href="#Special-Builtins">Special Builtins</a>).
</p>
<p>If no options are supplied and a <var class="var">name</var> is not a shell builtin,
<code class="code">enable</code> will attempt to load <var class="var">name</var> from a shared object named
@@ -5780,8 +5836,10 @@ or there is an error loading a new builtin from a shared object.
<p>Display helpful information about builtin commands.
If <var class="var">pattern</var> is specified, <code class="code">help</code> gives detailed help
on all commands matching <var class="var">pattern</var>, otherwise it displays
a list of all builtins and shell compound commands.
on all commands matching <var class="var">pattern</var>
as described below;
otherwise it displays a list of
all builtins and shell compound commands.
</p>
<p>Options, if supplied, have the following meanings:
</p>
@@ -5797,6 +5855,18 @@ a list of all builtins and shell compound commands.
</p></dd>
</dl>
<p>If <var class="var">pattern</var> contains pattern matching characters
(see <a class="pxref" href="#Pattern-Matching">Pattern Matching</a>)
it&rsquo;s treated as a shell pattern and
<code class="code">help</code> prints the description of each
help topic matching <var class="var">pattern</var>.
</p>
<p>If not, and <var class="var">pattern</var> exactly matches the name of a help topic,
<code class="code">help</code> prints the description
associated with that topic.
Otherwise, <code class="code">help</code> performs prefix matching and
prints the descriptions of all matching help topics.
</p>
<p>The return status is zero unless no command matches <var class="var">pattern</var>.
</p>
</dd>
@@ -6272,7 +6342,9 @@ allow this value to be set).
</p>
</dd>
<dt><code class="code">-q</code></dt>
<dd><p>The maximum number of bytes in <small class="sc">POSIX</small> message queues.
<dd><p>The maximum number of bytes in
<small class="sc">POSIX</small>
message queues.
</p>
</dd>
<dt><code class="code">-r</code></dt>
@@ -6338,7 +6410,7 @@ If no option is supplied, then <samp class="option">-f</samp> is assumed.
<samp class="option">-b</samp>,
<samp class="option">-k</samp>,
<samp class="option">-n</samp> and <samp class="option">-u</samp>, which are unscaled values;
and, when in <small class="sc">POSIX</small> Mode (see <a class="pxref" href="#Bash-POSIX-Mode">Bash and POSIX</a>),
and, when in <small class="sc">POSIX</small> mode (see <a class="pxref" href="#Bash-POSIX-Mode">Bash and POSIX</a>),
<samp class="option">-c</samp> and <samp class="option">-f</samp>, which are in 512-byte increments.
</p>
<p>The return status is zero unless an invalid option or argument is supplied,
@@ -6585,7 +6657,8 @@ This option is disabled by default.
</p>
</dd>
<dt><code class="code">posix</code></dt>
<dd><p>Change the behavior of Bash where the default operation differs
<dd><p>Enable <small class="sc">POSIX</small> mode;
change the behavior of Bash where the default operation differs
from the <small class="sc">POSIX</small> standard to match the standard
(see <a class="pxref" href="#Bash-POSIX-Mode">Bash and POSIX</a>).
This is intended to make Bash behave as a strict superset of that
@@ -7640,9 +7713,9 @@ being closed.
</dd>
<dt><a id="index-CHILD_005fMAX"></a><span><code class="code">CHILD_MAX</code><a class="copiable-link" href="#index-CHILD_005fMAX"> &para;</a></span></dt>
<dd><p>Set the number of exited child status values for the shell to remember.
Bash will not allow this value to be decreased below a <small class="sc">POSIX</small>-mandated
minimum, and there is a maximum value (currently 8192) that this may
not exceed.
Bash will not allow this value to be decreased below a
<small class="sc">POSIX</small>-mandated minimum,
and there is a maximum value (currently 8192) that this may not exceed.
The minimum value is system-dependent.
</p>
</dd>
@@ -7752,7 +7825,7 @@ running in an Emacs shell buffer and disables line editing.
<dd><p>Expanded and executed similarly to <code class="code">BASH_ENV</code>
(see <a class="pxref" href="#Bash-Startup-Files">Bash Startup Files</a>)
when an interactive shell is invoked in
<small class="sc">POSIX</small> Mode (see <a class="pxref" href="#Bash-POSIX-Mode">Bash and POSIX</a>).
<small class="sc">POSIX</small> mode (see <a class="pxref" href="#Bash-POSIX-Mode">Bash and POSIX</a>).
</p>
</dd>
<dt><a id="index-EPOCHREALTIME"></a><span><code class="code">EPOCHREALTIME</code><a class="copiable-link" href="#index-EPOCHREALTIME"> &para;</a></span></dt>
@@ -7917,14 +7990,19 @@ quick substitution, and tokenization
The first character is the <em class="dfn">history expansion</em> character,
the character which begins a history expansion, normally
&lsquo;<samp class="samp">!</samp>&rsquo;.
The second character is the &ldquo;quick substitution&rdquo; character, normally
The second character is the
<em class="dfn">quick substitution</em>
character, normally
&lsquo;<samp class="samp">^</samp>&rsquo;.
When it appears as the first character on the line,
history substitution repeats the previous command,
replacing one string with another.
The optional third character is the character which indicates that
the remainder of the line is a comment when found as the first character
of a word, usually &lsquo;<samp class="samp">#</samp>&rsquo;.
The optional third character is the
<em class="dfn">history comment</em>
character, normally &lsquo;<samp class="samp">#</samp>&rsquo;,
which indicates
that the remainder of the line is a comment
when it appears as the first character of a word.
The history comment character disables history substitution
for the remaining words on the line.
It does not necessarily cause the shell parser to treat the rest of the
@@ -8272,27 +8350,30 @@ subsequently reset.
</p>
</dd>
<dt><a id="index-READLINE_005fARGUMENT"></a><span><code class="code">READLINE_ARGUMENT</code><a class="copiable-link" href="#index-READLINE_005fARGUMENT"> &para;</a></span></dt>
<dd><p>Any numeric argument given to a Readline command that was defined using
<dd><p>Any numeric argument given to a Readline
command that was defined using
&lsquo;<samp class="samp">bind -x</samp>&rsquo; (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>
when it was invoked.
</p>
</dd>
<dt><a id="index-READLINE_005fLINE"></a><span><code class="code">READLINE_LINE</code><a class="copiable-link" href="#index-READLINE_005fLINE"> &para;</a></span></dt>
<dd><p>The contents of the Readline line buffer, for use
with &lsquo;<samp class="samp">bind -x</samp>&rsquo; (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
<dd><p>The contents of the Readline
line buffer, for use with
&lsquo;<samp class="samp">bind -x</samp>&rsquo; (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
</p>
</dd>
<dt><a id="index-READLINE_005fMARK"></a><span><code class="code">READLINE_MARK</code><a class="copiable-link" href="#index-READLINE_005fMARK"> &para;</a></span></dt>
<dd><p>The position of the <em class="dfn">mark</em> (saved insertion point) in the
Readline line buffer, for use
<dd><p>The position of the <em class="dfn">mark</em> (saved insertion point) in the Readline
line buffer, for use
with &lsquo;<samp class="samp">bind -x</samp>&rsquo; (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
The characters between the insertion point and the mark are often
called the <em class="dfn">region</em>.
</p>
</dd>
<dt><a id="index-READLINE_005fPOINT"></a><span><code class="code">READLINE_POINT</code><a class="copiable-link" href="#index-READLINE_005fPOINT"> &para;</a></span></dt>
<dd><p>The position of the insertion point in the Readline line buffer, for use
with &lsquo;<samp class="samp">bind -x</samp>&rsquo; (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
<dd><p>The position of the insertion point in the Readline
line buffer, for use with
&lsquo;<samp class="samp">bind -x</samp>&rsquo; (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
</p>
</dd>
<dt><a id="index-REPLY"></a><span><code class="code">REPLY</code><a class="copiable-link" href="#index-REPLY"> &para;</a></span></dt>
@@ -8328,6 +8409,8 @@ as &lsquo;<samp class="samp">on</samp>&rsquo; by &lsquo;<samp class="samp">set -
If this variable is in the environment when Bash
starts up, the shell enables each option in the list before
reading any startup files.
If this variable is exported, child shells will enable each option
in the list.
This variable is readonly.
</p>
</dd>
@@ -8530,8 +8613,11 @@ This is on by default if the shell is invoked as <code class="code">sh</code>.
</p>
</dd>
<dt><code class="code">--posix</code></dt>
<dd><p>Change the behavior of Bash where the default operation differs
from the <small class="sc">POSIX</small> standard to match the standard.
<dd><p>Enable <small class="sc">POSIX</small> mode;
change the behavior of Bash
where the default operation differs from the
<small class="sc">POSIX</small>
standard to match the standard.
This is intended to make Bash behave as a strict superset of that
standard.
See <a class="xref" href="#Bash-POSIX-Mode">Bash and POSIX</a>, for a description of the Bash <small class="sc">POSIX</small> mode.
@@ -8632,21 +8718,23 @@ and arguments passed to that script.
</dl>
<a class="index-entry-id" id="index-login-shell"></a>
<p>A <em class="emph">login</em> shell is one whose first character of argument zero is
<p>A <em class="dfn">login shell</em> is one whose first character of argument zero is
&lsquo;<samp class="samp">-</samp>&rsquo;, or one invoked with the <samp class="option">--login</samp> option.
</p>
<a class="index-entry-id" id="index-interactive-shell"></a>
<p>An <em class="emph">interactive</em> shell is one started without non-option arguments,
unless <samp class="option">-s</samp> is specified, without specifying the <samp class="option">-c</samp> option,
and whose input and output (using the standard error) are both
connected to terminals (as determined by <code class="code">isatty(3)</code>), or one
started with the <samp class="option">-i</samp> option.
<p>An <em class="dfn">interactive shell</em> is one started without non-option arguments,
unless <samp class="option">-s</samp> is specified,
without specifying the <samp class="option">-c</samp> option,
and whose standard input and standard error are both
connected to terminals (as determined by
<i class="i">isatty(3)</i>),
or one started with the <samp class="option">-i</samp> option.
See <a class="xref" href="#Interactive-Shells">Interactive Shells</a>, for more information.
</p>
<p>If arguments remain after option processing, and neither the
<samp class="option">-c</samp> nor the <samp class="option">-s</samp>
option has been supplied, the first argument is assumed to
be the name of a file containing shell commands (see <a class="pxref" href="#Shell-Scripts">Shell Scripts</a>).
option has been supplied, the first argument is treated as
the name of a file containing shell commands (see <a class="pxref" href="#Shell-Scripts">Shell Scripts</a>).
When Bash is invoked in this fashion, <code class="code">$0</code>
is set to the name of the file, and the positional parameters
are set to the remaining arguments.
@@ -8654,6 +8742,11 @@ Bash reads and executes commands from this file, then exits.
Bash&rsquo;s exit status is the exit status of the last command executed
in the script.
If no commands are executed, the exit status is 0.
Bash
first attempts to open the file in the current directory,
and, if no file is found, searches the directories in
<code class="env">PATH</code>
for the script.
</p>
<hr>
</div>
@@ -8718,39 +8811,48 @@ Bash behaves as if the following command were executed:
filename.
</p>
<p>As noted above, if a non-interactive shell is invoked with the
<samp class="option">--login</samp> option, Bash attempts to read and execute commands from the
<samp class="option">--login</samp> option,
Bash attempts to read and execute commands from the
login shell startup files.
</p>
<h4 class="subsubheading" id="Invoked-with-name-sh"><span>Invoked with name <code class="code">sh</code><a class="copiable-link" href="#Invoked-with-name-sh"> &para;</a></span></h4>
<p>If Bash is invoked with the name <code class="code">sh</code>, it tries to mimic the
startup behavior of historical versions of <code class="code">sh</code> as closely as
possible, while conforming to the <small class="sc">POSIX</small> standard as well.
<p>If Bash is invoked with the name <code class="command">sh</code>,
it tries to mimic the startup behavior of historical versions of
<code class="command">sh</code> as closely as possible,
while conforming to the
<small class="sc">POSIX</small>
standard as well.
</p>
<p>When invoked as an interactive login shell, or as a non-interactive
shell with the <samp class="option">--login</samp> option, it first attempts to read
and execute commands from <samp class="file">/etc/profile</samp> and <samp class="file">~/.profile</samp>, in
that order.
and execute commands from
<samp class="file">/etc/profile</samp> and <samp class="file">~/.profile</samp>,
in that order.
The <samp class="option">--noprofile</samp> option inhibits this behavior.
</p>
<p>When invoked as an interactive shell with the name <code class="code">sh</code>, Bash
looks for the variable <code class="env">ENV</code>, expands its value if it is defined,
and uses the expanded value as the name of a file to read and execute.
Since a shell invoked as <code class="code">sh</code> does not attempt to read and execute
commands from any other startup files, the <samp class="option">--rcfile</samp> option has
no effect.
<p>When invoked as an interactive shell with the name <code class="command">sh</code>, Bash
looks for the variable <code class="env">ENV</code>,
expands its value if it is defined, and uses the
expanded value as the name of a file to read and execute.
Since a shell invoked as <code class="command">sh</code>
does not attempt to read and execute commands from any other startup
files, the
<samp class="option">--rcfile</samp>
option has no effect.
</p>
<p>A non-interactive shell invoked with the name <code class="code">sh</code> does not attempt
to read any other startup files.
<p>A non-interactive shell invoked with the name <code class="command">sh</code>
does not attempt to read any other startup files.
</p>
<p>When invoked as <code class="code">sh</code>, Bash enters <small class="sc">POSIX</small> mode after reading
<p>When invoked as <code class="command">sh</code>, Bash enters <small class="sc">POSIX</small> mode after reading
the startup files.
</p>
<h4 class="subsubheading" id="Invoked-in-posix-mode"><span>Invoked in <small class="sc">POSIX</small> mode<a class="copiable-link" href="#Invoked-in-posix-mode"> &para;</a></span></h4>
<p>When Bash is started in <small class="sc">POSIX</small> mode, as with the
<samp class="option">--posix</samp> command line option, it follows the <small class="sc">POSIX</small> standard
for startup files.
<samp class="option">--posix</samp> command line option, it follows the
<small class="sc">POSIX</small>
standard for startup files.
In this mode, interactive shells expand the <code class="env">ENV</code> variable
and read and execute commands from the file whose name is the
expanded value.
@@ -8758,14 +8860,17 @@ No other startup files are read.
</p>
<h4 class="subsubheading" id="Invoked-by-remote-shell-daemon"><span>Invoked by remote shell daemon<a class="copiable-link" href="#Invoked-by-remote-shell-daemon"> &para;</a></span></h4>
<p>Bash attempts to determine when it is being run with its standard input
<p>Bash
attempts to determine when it is being run with its standard input
connected to a network connection, as when executed by
the historical and rarely-seen remote shell daemon, usually <code class="code">rshd</code>,
or the secure shell daemon <code class="code">sshd</code>.
If Bash
If
Bash
determines it is being run non-interactively in this fashion,
it reads and executes commands from <samp class="file">~/.bashrc</samp>, if that
file exists and is readable.
it reads and executes commands from
<samp class="file">~/.bashrc</samp>,
if that file exists and is readable.
Bash does not read this file if invoked as <code class="code">sh</code>.
The
<samp class="option">--norc</samp>
@@ -9138,7 +9243,9 @@ this returns true if an element with that key is set.
When used with the <code class="code">[[</code> command, this performs pattern matching as
described above (see <a class="pxref" href="#Conditional-Constructs">Conditional Constructs</a>).
</p>
<p>&lsquo;<samp class="samp">=</samp>&rsquo; should be used with the <code class="code">test</code> command for <small class="sc">POSIX</small> conformance.
<p>&lsquo;<samp class="samp">=</samp>&rsquo; should be used with the <code class="code">test</code> command for
<small class="sc">POSIX</small>
conformance.
</p>
</dd>
<dt><code class="code"><var class="var">string1</var> != <var class="var">string2</var></code></dt>
@@ -9414,7 +9521,8 @@ There is no maximum
limit on the size of an array, nor any requirement that members
be indexed or assigned contiguously.
Indexed arrays are referenced using arithmetic expressions
that must expand to an integer (see <a class="pxref" href="#Shell-Arithmetic">Shell Arithmetic</a>)) and are zero-based;
that must expand to an integer (see <a class="pxref" href="#Shell-Arithmetic">Shell Arithmetic</a>))
and are zero-based;
associative arrays use arbitrary strings.
Unless otherwise noted, indexed array indices must be non-negative integers.
</p>
@@ -9427,7 +9535,7 @@ using the syntax
<p>The <var class="var">subscript</var>
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero.
To explicitly declare an array, use
To explicitly declare an indexed array, use
</p><div class="example">
<pre class="example-preformatted">declare -a <var class="var">name</var>
</pre></div>
@@ -9443,9 +9551,8 @@ The syntax
<pre class="example-preformatted">declare -A <var class="var">name</var>
</pre></div>
<p>Attributes may be
specified for an array variable using the <code class="code">declare</code> and
<code class="code">readonly</code> builtins.
<p>Attributes may be specified for an array variable using the
<code class="code">declare</code> and <code class="code">readonly</code> builtins.
Each attribute applies to all members of an array.
</p>
<p>Arrays are assigned using compound assignments of the form
@@ -9492,8 +9599,10 @@ interpreted as relative to one greater than the maximum index of
<var class="var">name</var>, so negative indices count back from the end of the
array, and an index of -1 references the last element.
</p>
<p>The &lsquo;<samp class="samp">+=</samp>&rsquo; operator appends to an array variable when assigning
using the compound assignment syntax; see <a class="ref" href="#Shell-Parameters">Shell Parameters</a> above.
<p>The &lsquo;<samp class="samp">+=</samp>&rsquo;
operator appends to an array variable when assigning
using the compound assignment syntax; see
<a class="ref" href="#Shell-Parameters">Shell Parameters</a> above.
</p>
<p>An array element is referenced using
<code class="code">${<var class="var">name</var>[<var class="var">subscript</var>]}</code>.
@@ -9957,7 +10066,8 @@ Next: <a href="#Shell-Compatibility-Mode" accesskey="n" rel="next">Shell Compati
<h4 class="subsection"><span>6.11.1 What is POSIX?<a class="copiable-link" href="#What-is-POSIX_003f"> &para;</a></span></h4>
<a class="index-entry-id" id="index-POSIX-description"></a>
<p><small class="sc">POSIX</small> is the name for a family of standards based on Unix.
<p><small class="sc">POSIX</small>
is the name for a family of standards based on Unix.
A number of Unix services, tools, and functions are part of the standard,
ranging from the basic system calls and C library functions to common
applications and tools to system administration and management.
@@ -9989,11 +10099,11 @@ pipelines, argument handling, variable expansion, and quoting.
shell to provide the desired functionality, are specified as
being part of the shell; examples of these are <code class="code">eval</code> and
<code class="code">export</code>.
Other utilities appear in the sections of POSIX not
Other utilities appear in the sections of <small class="sc">POSIX</small> not
devoted to the shell which are commonly (and in some cases must
be) implemented as builtin commands, such as
<code class="code">read</code> and <code class="code">test</code>.
POSIX also specifies aspects of the shell&rsquo;s interactive
<small class="sc">POSIX</small> also specifies aspects of the shell&rsquo;s interactive
behavior, including job control and command
line editing.
Only vi-style line editing commands have been standardized;
@@ -10008,7 +10118,7 @@ emacs editing commands were left out due to objections.
specification, there are areas where the Bash default behavior
differs from the specification.
The Bash <em class="dfn">posix mode</em> changes the Bash
behavior in these areas so that it conforms more closely
behavior in these areas so that it conforms more strictly
to the standard.
</p>
<p>Starting Bash with the <samp class="option">--posix</samp> command-line option or executing
@@ -10019,7 +10129,7 @@ match that specified by <small class="sc">POSIX</small> in areas where the Bash
<p>When invoked as <code class="code">sh</code>, Bash enters <small class="sc">POSIX</small> mode after reading the
startup files.
</p>
<p>The following list is what&rsquo;s changed when &lsquo;<small class="sc">POSIX</small> mode&rsquo; is in effect:
<p>The following list is what&rsquo;s changed when <small class="sc">POSIX</small> mode is in effect:
</p>
<ol class="enumerate">
<li> Bash ensures that the <code class="env">POSIXLY_CORRECT</code> variable is set.
@@ -10444,13 +10554,17 @@ strcoll(3).
</dd>
<dt><code class="code">compat41</code></dt>
<dd><ul class="itemize mark-bullet">
<li>In posix mode, <code class="code">time</code> may be followed by options and still be
recognized as a reserved word (this is <small class="sc">POSIX</small> interpretation 267).
</li><li>In posix mode, the parser requires that an even number of single
<li>In <small class="sc">POSIX</small> mode, <code class="code">time</code> may be followed by options and still be
recognized as a reserved word (this is
<small class="sc">POSIX</small>
interpretation 267).
</li><li>In <small class="sc">POSIX</small> mode, the parser requires that an even number of single
quotes occur in the <var class="var">word</var> portion of a double-quoted ${&hellip;}
parameter expansion and treats them specially, so that characters within
the single quotes are considered quoted
(this is <small class="sc">POSIX</small> interpretation 221).
(this is
<small class="sc">POSIX</small>
interpretation 221).
</li></ul>
</dd>
@@ -10458,10 +10572,12 @@ the single quotes are considered quoted
<dd><ul class="itemize mark-bullet">
<li>The replacement string in double-quoted pattern substitution does not
undergo quote removal, as it does in versions after bash-4.2.
</li><li>In posix mode, single quotes are considered special when expanding
</li><li>In <small class="sc">POSIX</small> mode, single quotes are considered special when expanding
the <var class="var">word</var> portion of a double-quoted ${&hellip;} parameter expansion
and can be used to quote a closing brace or other special character
(this is part of <small class="sc">POSIX</small> interpretation 221);
(this is part of
<small class="sc">POSIX</small>
interpretation 221);
in later versions, single quotes
are not special within double-quoted word expansions.
</li></ul>
@@ -10470,7 +10586,7 @@ are not special within double-quoted word expansions.
<dt><code class="code">compat43</code></dt>
<dd><ul class="itemize mark-bullet">
<li>Word expansion errors are considered non-fatal errors that cause the
current command to fail, even in posix mode
current command to fail, even in <small class="sc">POSIX</small> mode
(the default behavior is to make them fatal errors that cause the shell
to exit).
</li><li>When executing a shell function, the loop state (while/until/etc.)
@@ -10490,7 +10606,8 @@ or <code class="code">continue</code> will cause the subshell to exit.
Bash-5.0 and later reset the loop state to prevent the exit.
</li><li>Variable assignments preceding builtins like <code class="code">export</code> and <code class="code">readonly</code>
that set attributes continue to affect variables with the same
name in the calling environment even if the shell is not in posix
name in the calling environment even if the shell is not in
<small class="sc">POSIX</small>
mode.
</li></ul>
@@ -11472,9 +11589,10 @@ A sample value might be &lsquo;<samp class="samp">\e[01;33m</samp>&rsquo;.
</p>
</dd>
<dt><a id="index-active_002dregion_002dend_002dcolor"></a><span><code class="code">active-region-end-color</code><a class="copiable-link" href="#index-active_002dregion_002dend_002dcolor"> &para;</a></span></dt>
<dd><p>A string variable that &quot;undoes&quot; the effects of <code class="code">active-region-start-color</code>
and restores &quot;normal&quot; terminal display appearance after displaying text
in the active region.
<dd><p>A string variable that &ldquo;undoes&rdquo;
the effects of <code class="code">active-region-start-color</code>
and restores &ldquo;normal&rdquo;
terminal display appearance after displaying text in the active region.
This string must not take up any physical character positions on the display,
so it should consist only of terminal escape sequences.
It is output to the terminal after displaying the text in the active region.
@@ -11708,7 +11826,7 @@ If set to zero, any existing history entries are deleted and no new entries
are saved.
If set to a value less than zero, the number of history entries is not
limited.
By default, Bash sets the the maximum number of history entries to
By default, Bash sets the maximum number of history entries to
the value of the <code class="code">HISTSIZE</code> shell variable.
If you try to set <var class="var">history-size</var> to a non-numeric value,
the maximum number of history entries will be set to 500.
@@ -12078,7 +12196,7 @@ set of backslash escapes is available:
<p>When entering the text of a macro, single or double quotes must
be used to indicate a macro definition.
Unquoted text is assumed to be a function name.
Tthe backslash escapes described above are expanded
The backslash escapes described above are expanded
in the macro body.
Backslash will quote any other character in the macro text,
including &lsquo;<samp class="samp">&quot;</samp>&rsquo; and &lsquo;<samp class="samp">'</samp>&rsquo;.
@@ -12232,7 +12350,7 @@ Previous: <a href="#Conditional-Init-Constructs" accesskey="p" rel="prev">Condit
binding, variable assignment, and conditional syntax.
</p>
<div class="example">
<pre class="example-preformatted"># This file controls the behaviour of line input editing for
<pre class="example-preformatted"># This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
@@ -12355,10 +12473,13 @@ Command names without an accompanying key sequence are unbound by default.
position, and <em class="dfn">mark</em> refers to a cursor position saved by the
<code class="code">set-mark</code> command.
The text between the point and mark is referred to as the <em class="dfn">region</em>.
Readline has the concept of an <em class="emph">active region</em>:
Readline
has the concept of an <em class="emph">active region</em>:
when the region is active,
Readline redisplay highlights the region using the
value of the <code class="code">active-region-start-color</code> variable.
value of the
<code class="code">active-region-start-color</code>
variable.
The <code class="code">enable-active-region</code> variable turns this on and off.
Several commands set the region to active; those are noted below.
</p>
@@ -12930,7 +13051,7 @@ using the following format, writing information on separate lines:
<li>the number of matches <var class="var">N</var>;
</li><li>the word being completed;
</li><li><var class="var">S</var>:<var class="var">E</var>,
where S and E are the start and end offsets of the word
where <var class="var">S</var> and <var class="var">E</var> are the start and end offsets of the word
in the Readline line buffer; then
</li><li>each match, one per line
</li></ul>
@@ -13220,7 +13341,7 @@ pathname expansion.
This performs alias and history expansion,
$&rsquo;<var class="var">string</var>&rsquo; and $&quot;<var class="var">string</var>&quot; quoting,
tilde expansion, parameter and variable expansion, arithmetic expansion,
command and proces substitution,
command and process substitution,
word splitting, and quote removal.
An explicit argument suppresses command and process substitution.
</p>
@@ -15391,7 +15512,7 @@ to <a class="email" href="mailto:bug-bash@gnu.org">bug-bash@gnu.org</a> or <a cl
<li>The version number of Bash.
</li><li>The hardware and operating system.
</li><li>The compiler used to compile Bash.
</li><li>A description of the bug behaviour.
</li><li>A description of the bug behavior.
</li><li>A short script or &lsquo;recipe&rsquo; which exercises the bug and may be used
to reproduce it.
</li></ul>
+305 -273
View File
@@ -2,12 +2,12 @@ This is bashref.info, produced by makeinfo version 7.1 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 12 December 2024).
Bash shell (version 5.3, 8 January 2025).
This is Edition 5.3, last updated 12 December 2024, of The GNU Bash
This is Edition 5.3, last updated 8 January 2025, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2024 Free Software Foundation, Inc.
Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
@@ -27,10 +27,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 12 December 2024). The Bash home page is
Bash shell (version 5.3, 8 January 2025). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 12 December 2024, of The GNU Bash
This is Edition 5.3, last updated 8 January 2025, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -1449,7 +1449,7 @@ above. If a variable at the current local scope is unset, it remains so
function returns. Once the function returns, any instance of the
variable at a previous scope becomes visible. If the unset acts on a
variable at a previous scope, any instance of a variable with that name
that had been shadowed will become visible (see below how the
that had been shadowed becomes visible (see below how the
localvar_unset shell option changes this behavior).
The -f option to the declare (typeset) builtin command (*note
@@ -1551,6 +1551,10 @@ array variables. Namerefs can be unset using the -n option to the
is executed with the name of a nameref variable as an argument, the
variable referenced by the nameref variable is unset.
When the shell starts, it reads its environment and creates a shell
variable from each environment variable that has a valid name, as
described below (*note Environment::).

File: bashref.info, Node: Positional Parameters, Next: Special Parameters, Up: Shell Parameters
@@ -1740,7 +1744,7 @@ to the context of the expansion or the text between the braces.
closing braces, and at least one unquoted comma or a valid sequence
expression. Any incorrectly formed brace expansion is left unchanged.
A { or , may be quoted with a backslash to prevent its being
A { or , may be quoted with a backslash to prevent its being
considered part of a brace expression. To avoid conflicts with
parameter expansion, the string ${ is not considered eligible for
brace expansion, and inhibits brace expansion until the closing }.
@@ -1751,6 +1755,16 @@ of the strings to be generated is longer than in the above example:
or
chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
Brace expansion introduces a slight incompatibility with historical
versions of sh. sh does not treat opening or closing braces
specially when they appear as part of a word, and preserves them in the
output. Bash removes braces from words as a consequence of brace
expansion. For example, a word entered to sh as file{1,2} appears
identically in the output. Bash outputs that word as file1 file2
after brace expansion. Start Bash with the +B option or disable brace
expansion with the +B option to the set command (*note Shell Builtin
Commands::) for strict sh compatibility.

File: bashref.info, Node: Tilde Expansion, Next: Shell Parameter Expansion, Prev: Brace Expansion, Up: Shell Expansions
@@ -2378,7 +2392,7 @@ File: bashref.info, Node: Arithmetic Expansion, Next: Process Substitution, P
3.5.5 Arithmetic Expansion
--------------------------
Arithmetic expansion evalutes an arithmetic expression and substitutes
Arithmetic expansion evaluates an arithmetic expression and substitutes
the result. The format for arithmetic expansion is:
$(( EXPRESSION ))
@@ -2531,9 +2545,9 @@ patterns in GLOBIGNORE. The dotglob option is disabled when
GLOBIGNORE is unset. The GLOBIGNORE pattern matching honors the
setting of the extglob shell option.
After the pattern is expanded and matched against filenames, the
value of the GLOBSORT shell variable controls how the results are
sorted, as described below (*note Bash Variables::).
The value of the GLOBSORT shell variable controls how the results
of pathname expansion are sorted, as described below (*note Bash
Variables::).

File: bashref.info, Node: Pattern Matching, Up: Filename Expansion
@@ -2765,11 +2779,12 @@ created; if it does exist it is truncated to zero size.
[N]>[|]WORD
If the redirection operator is >, and the noclobber option to the
set builtin has been enabled, the redirection fails if the file whose
name results from the expansion of WORD exists and is a regular file.
If the redirection operator is >|, or the redirection operator is >
and the noclobber option is not enabled, Bash attemps the redirection
even if the file named by WORD exists.
set builtin command has been enabled, the redirection fails if the
file whose name results from the expansion of WORD exists and is a
regular file. If the redirection operator is >|, or the redirection
operator is > and the noclobber option to the set builtin is not
enabled, Bash attempts the redirection even if the file named by WORD
exists.
3.6.3 Appending Redirected Output
---------------------------------
@@ -3839,7 +3854,7 @@ standard.
The ACTION is a command that is read and executed when the shell
receives any of the signals SIGSPEC. If ACTION is absent (and
there is a single SIGSPEC) or equal to -, each specified
SIGSPEC'ss disposition is reset to the value it had when the shell
SIGSPEC's disposition is reset to the value it had when the shell
was started. If ACTION is the null string, then the signal
specified by each SIGSPEC is ignored by the shell and commands it
invokes.
@@ -4054,7 +4069,7 @@ standard.
optional, and Readline does not expand the command string
before saving it. Since the entire key binding expression
must be a single argument, it should be enclosed in single
quotes. When SHELL-COMMAND is executed, the shell sets thex
quotes. When SHELL-COMMAND is executed, the shell sets the
READLINE_LINE variable to the contents of the Readline line
buffer and the READLINE_POINT and READLINE_MARK variables
to the current location of the insertion point and the saved
@@ -4306,7 +4321,8 @@ standard.
BASH_LOADABLES_PATH is system-dependent, and may include "." to
force a search of the current directory. The -d option will
delete a builtin loaded with -f. If -s is used with -f, the
new builtin becomes a special builtin (*note Special Builtins::).
new builtin becomes a POSIX special builtin (*note Special
Builtins::).
If no options are supplied and a NAME is not a shell builtin,
enable will attempt to load NAME from a shared object named NAME,
@@ -4320,8 +4336,8 @@ standard.
Display helpful information about builtin commands. If PATTERN is
specified, help gives detailed help on all commands matching
PATTERN, otherwise it displays a list of all builtins and shell
compound commands.
PATTERN as described below; otherwise it displays a list of all
builtins and shell compound commands.
Options, if supplied, have the following meanings:
@@ -4333,6 +4349,15 @@ standard.
-s
Display only a short usage synopsis for each PATTERN
If PATTERN contains pattern matching characters (*note Pattern
Matching::) it's treated as a shell pattern and help prints the
description of each help topic matching PATTERN.
If not, and PATTERN exactly matches the name of a help topic,
help prints the description associated with that topic.
Otherwise, help performs prefix matching and prints the
descriptions of all matching help topics.
The return status is zero unless no command matches PATTERN.
let
@@ -4759,7 +4784,7 @@ standard.
Values are in 1024-byte increments, except for -t, which is in
seconds; -R, which is in microseconds; -p, which is in units of
512-byte blocks; -P, -T, -b, -k, -n and -u, which are
unscaled values; and, when in POSIX Mode (*note Bash POSIX Mode::),
unscaled values; and, when in POSIX mode (*note Bash POSIX Mode::),
-c and -f, which are in 512-byte increments.
The return status is zero unless an invalid option or argument is
@@ -4958,10 +4983,11 @@ parameters, or to display the names and values of shell variables.
successfully. This option is disabled by default.
posix
Change the behavior of Bash where the default operation
differs from the POSIX standard to match the standard
(*note Bash POSIX Mode::). This is intended to make Bash
behave as a strict superset of that standard.
Enable POSIX mode; change the behavior of Bash where the
default operation differs from the POSIX standard to
match the standard (*note Bash POSIX Mode::). This is
intended to make Bash behave as a strict superset of that
standard.
privileged
Same as -p.
@@ -5879,7 +5905,7 @@ Variables::).
ENV
Expanded and executed similarly to BASH_ENV (*note Bash Startup
Files::) when an interactive shell is invoked in POSIX Mode (*note
Files::) when an interactive shell is invoked in POSIX mode (*note
Bash POSIX Mode::).
EPOCHREALTIME
@@ -6000,15 +6026,16 @@ Variables::).
substitution, and tokenization (*note History Interaction::). The
first character is the “history expansion” character, the character
which begins a history expansion, normally !. The second
character is the "quick substitution" character, normally ^.
character is the quick substitution character, normally ^.
When it appears as the first character on the line, history
substitution repeats the previous command, replacing one string
with another. The optional third character is the character which
indicates that the remainder of the line is a comment when found as
the first character of a word, usually #. The history comment
character disables history substitution for the remaining words on
the line. It does not necessarily cause the shell parser to treat
the rest of the line as a comment.
with another. The optional third character is the “history
comment” character, normally #, which indicates that the
remainder of the line is a comment when it appears as the first
character of a word. The history comment character disables
history substitution for the remaining words on the line. It does
not necessarily cause the shell parser to treat the rest of the
line as a comment.
HISTCMD
The history number, or index in the history list, of the current
@@ -6308,7 +6335,8 @@ Variables::).
SHELLOPTS are those reported as on by set -o. If this
variable is in the environment when Bash starts up, the shell
enables each option in the list before reading any startup files.
This variable is readonly.
If this variable is exported, child shells will enable each option
in the list. This variable is readonly.
SHLVL
Incremented by one each time a new instance of Bash is started.
@@ -6469,10 +6497,11 @@ single-character options to be recognized.
shell. This is on by default if the shell is invoked as sh.
--posix
Change the behavior of Bash where the default operation differs
from the POSIX standard to match the standard. This is intended to
make Bash behave as a strict superset of that standard. *Note Bash
POSIX Mode::, for a description of the Bash POSIX mode.
Enable POSIX mode; change the behavior of Bash where the default
operation differs from the POSIX standard to match the standard.
This is intended to make Bash behave as a strict superset of that
standard. *Note Bash POSIX Mode::, for a description of the Bash
POSIX mode.
--restricted
Equivalent to -r. Make the shell a restricted shell (*note The
@@ -6543,23 +6572,25 @@ invocation which are not available with the set builtin.
-
Equivalent to --.
A _login_ shell is one whose first character of argument zero is -,
A login shell is one whose first character of argument zero is -,
or one invoked with the --login option.
An _interactive_ shell is one started without non-option arguments,
An interactive shell is one started without non-option arguments,
unless -s is specified, without specifying the -c option, and whose
input and output (using the standard error) are both connected to
terminals (as determined by isatty(3)), or one started with the -i
option. *Note Interactive Shells::, for more information.
standard input and standard error are both connected to terminals (as
determined by isatty(3)), or one started with the -i option. *Note
Interactive Shells::, for more information.
If arguments remain after option processing, and neither the -c nor
the -s option has been supplied, the first argument is assumed to be
the name of a file containing shell commands (*note Shell Scripts::).
When Bash is invoked in this fashion, $0 is set to the name of the
file, and the positional parameters are set to the remaining arguments.
Bash reads and executes commands from this file, then exits. Bash's
exit status is the exit status of the last command executed in the
script. If no commands are executed, the exit status is 0.
the -s option has been supplied, the first argument is treated as the
name of a file containing shell commands (*note Shell Scripts::). When
Bash is invoked in this fashion, $0 is set to the name of the file,
and the positional parameters are set to the remaining arguments. Bash
reads and executes commands from this file, then exits. Bash's exit
status is the exit status of the last command executed in the script.
If no commands are executed, the exit status is 0. Bash first attempts
to open the file in the current directory, and, if no file is found,
searches the directories in PATH for the script.

File: bashref.info, Node: Bash Startup Files, Next: Interactive Shells, Prev: Invoking Bash, Up: Bash Features
@@ -7156,7 +7187,7 @@ to using the syntax
The SUBSCRIPT is treated as an arithmetic expression that must evaluate
to a number greater than or equal to zero. To explicitly declare an
array, use
indexed array, use
declare -a NAME
(*note Bash Builtins::). The syntax
declare -a NAME[SUBSCRIPT]
@@ -7591,7 +7622,7 @@ editing commands were left out due to objections.
Although Bash is an implementation of the POSIX shell specification,
there are areas where the Bash default behavior differs from the
specification. The Bash “posix mode” changes the Bash behavior in these
areas so that it conforms more closely to the standard.
areas so that it conforms more strictly to the standard.
Starting Bash with the --posix command-line option or executing
set -o posix while Bash is running will cause Bash to conform more
@@ -7601,7 +7632,7 @@ specified by POSIX in areas where the Bash default differs.
When invoked as sh, Bash enters POSIX mode after reading the
startup files.
The following list is what's changed when 'POSIX mode' is in effect:
The following list is what's changed when POSIX mode is in effect:
1. Bash ensures that the POSIXLY_CORRECT variable is set.
@@ -7984,10 +8015,10 @@ required for bash-5.1 and later versions.
collation sequence and strcoll(3).
compat41
• In posix mode, time may be followed by options and still be
• In POSIX mode, time may be followed by options and still be
recognized as a reserved word (this is POSIX interpretation
267).
• In posix mode, the parser requires that an even number of
• In POSIX mode, the parser requires that an even number of
single quotes occur in the WORD portion of a double-quoted
${...} parameter expansion and treats them specially, so that
characters within the single quotes are considered quoted
@@ -7997,7 +8028,7 @@ required for bash-5.1 and later versions.
• The replacement string in double-quoted pattern substitution
does not undergo quote removal, as it does in versions after
bash-4.2.
• In posix mode, single quotes are considered special when
• In POSIX mode, single quotes are considered special when
expanding the WORD portion of a double-quoted ${...} parameter
expansion and can be used to quote a closing brace or other
special character (this is part of POSIX interpretation 221);
@@ -8006,7 +8037,7 @@ required for bash-5.1 and later versions.
compat43
• Word expansion errors are considered non-fatal errors that
cause the current command to fail, even in posix mode (the
cause the current command to fail, even in POSIX mode (the
default behavior is to make them fatal errors that cause the
shell to exit).
• When executing a shell function, the loop state
@@ -8025,7 +8056,7 @@ required for bash-5.1 and later versions.
• Variable assignments preceding builtins like export and
readonly that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode.
shell is not in POSIX mode.
compat50 (set using BASH_COMPAT)
• Bash-5.1 changed the way $RANDOM is generated to introduce
@@ -8948,9 +8979,9 @@ Variable Settings
list. If set to zero, any existing history entries are
deleted and no new entries are saved. If set to a value less
than zero, the number of history entries is not limited. By
default, Bash sets the the maximum number of history entries
to the value of the HISTSIZE shell variable. If you try to
set HISTORY-SIZE to a non-numeric value, the maximum number of
default, Bash sets the maximum number of history entries to
the value of the HISTSIZE shell variable. If you try to set
HISTORY-SIZE to a non-numeric value, the maximum number of
history entries will be set to 500.
horizontal-scroll-mode
@@ -9230,7 +9261,7 @@ Key Bindings
When entering the text of a macro, single or double quotes must be
used to indicate a macro definition. Unquoted text is assumed to
be a function name. Tthe backslash escapes described above are
be a function name. The backslash escapes described above are
expanded in the macro body. Backslash will quote any other
character in the macro text, including " and '. For example,
the following binding will make ‘‘C-x \ insert a single \ into
@@ -9337,7 +9368,7 @@ File: bashref.info, Node: Sample Init File, Prev: Conditional Init Constructs,
Here is an example of an INPUTRC file. This illustrates key binding,
variable assignment, and conditional syntax.
# This file controls the behaviour of line input editing for
# This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
@@ -10113,8 +10144,9 @@ File: bashref.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up:
Expand the line by performing shell word expansions. This performs
alias and history expansion, $'STRING' and $"STRING" quoting, tilde
expansion, parameter and variable expansion, arithmetic expansion,
command and proces substitution, word splitting, and quote removal.
An explicit argument suppresses command and process substitution.
command and process substitution, word splitting, and quote
removal. An explicit argument suppresses command and process
substitution.
history-expand-line (M-^)
Perform history expansion on the current line.
@@ -11782,7 +11814,7 @@ fix, you are encouraged to submit that as well! Suggestions and
• The version number of Bash.
• The hardware and operating system.
• The compiler used to compile Bash.
• A description of the bug behaviour.
• A description of the bug behavior.
• A short script or 'recipe' which exercises the bug and may be used
to reproduce it.
@@ -12781,26 +12813,26 @@ D.1 Index of Shell Builtin Commands
(line 179)
* hash: Bourne Shell Builtins.
(line 231)
* help: Bash Builtins. (line 374)
* help: Bash Builtins. (line 375)
* history: Bash History Builtins.
(line 59)
* jobs: Job Control Builtins.
(line 28)
* kill: Job Control Builtins.
(line 61)
* let: Bash Builtins. (line 394)
* local: Bash Builtins. (line 403)
* logout: Bash Builtins. (line 428)
* mapfile: Bash Builtins. (line 433)
* let: Bash Builtins. (line 404)
* local: Bash Builtins. (line 413)
* logout: Bash Builtins. (line 438)
* mapfile: Bash Builtins. (line 443)
* popd: Directory Stack Builtins.
(line 37)
* printf: Bash Builtins. (line 478)
* printf: Bash Builtins. (line 488)
* pushd: Directory Stack Builtins.
(line 70)
* pwd: Bourne Shell Builtins.
(line 263)
* read: Bash Builtins. (line 548)
* readarray: Bash Builtins. (line 659)
* read: Bash Builtins. (line 558)
* readarray: Bash Builtins. (line 669)
* readonly: Bourne Shell Builtins.
(line 275)
* return: Bourne Shell Builtins.
@@ -12809,7 +12841,7 @@ D.1 Index of Shell Builtin Commands
* shift: Bourne Shell Builtins.
(line 325)
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 668)
* source: Bash Builtins. (line 678)
* suspend: Job Control Builtins.
(line 139)
* test: Bourne Shell Builtins.
@@ -12820,12 +12852,12 @@ D.1 Index of Shell Builtin Commands
(line 444)
* true: Bourne Shell Builtins.
(line 510)
* type: Bash Builtins. (line 673)
* typeset: Bash Builtins. (line 710)
* ulimit: Bash Builtins. (line 716)
* type: Bash Builtins. (line 683)
* typeset: Bash Builtins. (line 720)
* ulimit: Bash Builtins. (line 726)
* umask: Bourne Shell Builtins.
(line 515)
* unalias: Bash Builtins. (line 824)
* unalias: Bash Builtins. (line 834)
* unset: Bourne Shell Builtins.
(line 533)
* wait: Job Control Builtins.
@@ -13000,55 +13032,55 @@ D.3 Parameter and Variable Index
* GLOBSORT: Bash Variables. (line 376)
* GROUPS: Bash Variables. (line 414)
* histchars: Bash Variables. (line 420)
* HISTCMD: Bash Variables. (line 435)
* HISTCONTROL: Bash Variables. (line 441)
* HISTFILE: Bash Variables. (line 459)
* HISTFILESIZE: Bash Variables. (line 465)
* HISTIGNORE: Bash Variables. (line 476)
* HISTCMD: Bash Variables. (line 436)
* HISTCONTROL: Bash Variables. (line 442)
* HISTFILE: Bash Variables. (line 460)
* HISTFILESIZE: Bash Variables. (line 466)
* HISTIGNORE: Bash Variables. (line 477)
* history-preserve-point: Readline Init File Syntax.
(line 234)
* history-size: Readline Init File Syntax.
(line 240)
* HISTSIZE: Bash Variables. (line 500)
* HISTTIMEFORMAT: Bash Variables. (line 507)
* HISTSIZE: Bash Variables. (line 501)
* HISTTIMEFORMAT: Bash Variables. (line 508)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 250)
* HOSTFILE: Bash Variables. (line 516)
* HOSTNAME: Bash Variables. (line 527)
* HOSTTYPE: Bash Variables. (line 530)
* HOSTFILE: Bash Variables. (line 517)
* HOSTNAME: Bash Variables. (line 528)
* HOSTTYPE: Bash Variables. (line 531)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 533)
* IGNOREEOF: Bash Variables. (line 534)
* input-meta: Readline Init File Syntax.
(line 258)
* INPUTRC: Bash Variables. (line 542)
* INSIDE_EMACS: Bash Variables. (line 546)
* INPUTRC: Bash Variables. (line 543)
* INSIDE_EMACS: Bash Variables. (line 547)
* isearch-terminators: Readline Init File Syntax.
(line 269)
* keymap: Readline Init File Syntax.
(line 276)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 552)
* LC_ALL: Bash Variables. (line 556)
* LC_COLLATE: Bash Variables. (line 560)
* LC_CTYPE: Bash Variables. (line 567)
* LANG <1>: Bash Variables. (line 553)
* LC_ALL: Bash Variables. (line 557)
* LC_COLLATE: Bash Variables. (line 561)
* LC_CTYPE: Bash Variables. (line 568)
* LC_MESSAGES: Creating Internationalized Scripts.
(line 51)
* LC_MESSAGES <1>: Bash Variables. (line 572)
* LC_NUMERIC: Bash Variables. (line 576)
* LC_TIME: Bash Variables. (line 580)
* LINENO: Bash Variables. (line 584)
* LINES: Bash Variables. (line 591)
* MACHTYPE: Bash Variables. (line 597)
* LC_MESSAGES <1>: Bash Variables. (line 573)
* LC_NUMERIC: Bash Variables. (line 577)
* LC_TIME: Bash Variables. (line 581)
* LINENO: Bash Variables. (line 585)
* LINES: Bash Variables. (line 592)
* MACHTYPE: Bash Variables. (line 598)
* MAIL: Bourne Shell Variables.
(line 24)
* MAILCHECK: Bash Variables. (line 601)
* MAILCHECK: Bash Variables. (line 602)
* MAILPATH: Bourne Shell Variables.
(line 29)
* MAPFILE: Bash Variables. (line 609)
* MAPFILE: Bash Variables. (line 610)
* mark-modified-lines: Readline Init File Syntax.
(line 306)
* mark-symlinked-directories: Readline Init File Syntax.
@@ -13059,46 +13091,46 @@ D.3 Parameter and Variable Index
(line 323)
* meta-flag: Readline Init File Syntax.
(line 258)
* OLDPWD: Bash Variables. (line 613)
* OLDPWD: Bash Variables. (line 614)
* OPTARG: Bourne Shell Variables.
(line 36)
* OPTERR: Bash Variables. (line 616)
* OPTERR: Bash Variables. (line 617)
* OPTIND: Bourne Shell Variables.
(line 40)
* OSTYPE: Bash Variables. (line 621)
* OSTYPE: Bash Variables. (line 622)
* output-meta: Readline Init File Syntax.
(line 328)
* page-completions: Readline Init File Syntax.
(line 337)
* PATH: Bourne Shell Variables.
(line 44)
* PIPESTATUS: Bash Variables. (line 624)
* POSIXLY_CORRECT: Bash Variables. (line 634)
* PPID: Bash Variables. (line 644)
* PROMPT_COMMAND: Bash Variables. (line 648)
* PROMPT_DIRTRIM: Bash Variables. (line 654)
* PS0: Bash Variables. (line 660)
* PIPESTATUS: Bash Variables. (line 625)
* POSIXLY_CORRECT: Bash Variables. (line 635)
* PPID: Bash Variables. (line 645)
* PROMPT_COMMAND: Bash Variables. (line 649)
* PROMPT_DIRTRIM: Bash Variables. (line 655)
* PS0: Bash Variables. (line 661)
* PS1: Bourne Shell Variables.
(line 53)
* PS2: Bourne Shell Variables.
(line 58)
* PS3: Bash Variables. (line 665)
* PS4: Bash Variables. (line 670)
* PWD: Bash Variables. (line 678)
* RANDOM: Bash Variables. (line 681)
* READLINE_ARGUMENT: Bash Variables. (line 689)
* READLINE_LINE: Bash Variables. (line 693)
* READLINE_MARK: Bash Variables. (line 697)
* READLINE_POINT: Bash Variables. (line 703)
* REPLY: Bash Variables. (line 707)
* PS3: Bash Variables. (line 666)
* PS4: Bash Variables. (line 671)
* PWD: Bash Variables. (line 679)
* RANDOM: Bash Variables. (line 682)
* READLINE_ARGUMENT: Bash Variables. (line 690)
* READLINE_LINE: Bash Variables. (line 694)
* READLINE_MARK: Bash Variables. (line 698)
* READLINE_POINT: Bash Variables. (line 704)
* REPLY: Bash Variables. (line 708)
* revert-all-at-newline: Readline Init File Syntax.
(line 350)
* search-ignore-case: Readline Init File Syntax.
(line 357)
* SECONDS: Bash Variables. (line 711)
* SHELL: Bash Variables. (line 721)
* SHELLOPTS: Bash Variables. (line 726)
* SHLVL: Bash Variables. (line 735)
* SECONDS: Bash Variables. (line 712)
* SHELL: Bash Variables. (line 722)
* SHELLOPTS: Bash Variables. (line 727)
* SHLVL: Bash Variables. (line 737)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 362)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -13107,15 +13139,15 @@ D.3 Parameter and Variable Index
(line 377)
* skip-completed-text: Readline Init File Syntax.
(line 383)
* SRANDOM: Bash Variables. (line 740)
* SRANDOM: Bash Variables. (line 742)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 749)
* TMOUT: Bash Variables. (line 788)
* TMPDIR: Bash Variables. (line 800)
* UID: Bash Variables. (line 804)
* TIMEFORMAT: Bash Variables. (line 751)
* TMOUT: Bash Variables. (line 790)
* TMPDIR: Bash Variables. (line 802)
* UID: Bash Variables. (line 806)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 396)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -13137,7 +13169,7 @@ D.4 Function Index
* accept-line (Newline or Return): Commands For History.
(line 6)
* alias-expand-line (): Miscellaneous Commands.
(line 133)
(line 134)
* backward-char (C-b): Commands For Moving. (line 18)
* backward-delete-char (Rubout): Commands For Text. (line 18)
* backward-kill-line (C-x Rubout): Commands For Killing.
@@ -13186,7 +13218,7 @@ D.4 Function Index
(line 50)
* digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6)
* display-shell-version (C-x C-v): Miscellaneous Commands.
(line 147)
(line 148)
* do-lowercase-version (M-A, M-B, M-X, ...): Miscellaneous Commands.
(line 14)
* downcase-word (M-l): Commands For Text. (line 69)
@@ -13199,7 +13231,7 @@ D.4 Function Index
* dynamic-complete-history (M-<TAB>): Commands For Completion.
(line 115)
* edit-and-execute-command (C-x C-e): Miscellaneous Commands.
(line 142)
(line 143)
* end-kbd-macro (C-x )): Keyboard Macros. (line 9)
* end-of-file (usually C-d): Commands For Text. (line 6)
* end-of-history (M->): Commands For History.
@@ -13225,9 +13257,9 @@ D.4 Function Index
* glob-list-expansions (C-x g): Miscellaneous Commands.
(line 114)
* history-and-alias-expand-line (): Miscellaneous Commands.
(line 136)
(line 137)
* history-expand-line (M-^): Miscellaneous Commands.
(line 126)
(line 127)
* history-search-backward (): Commands For History.
(line 53)
* history-search-forward (): Commands For History.
@@ -13241,7 +13273,7 @@ D.4 Function Index
* insert-completions (M-*): Commands For Completion.
(line 24)
* insert-last-argument (M-. or M-_): Miscellaneous Commands.
(line 139)
(line 140)
* kill-line (C-k): Commands For Killing.
(line 6)
* kill-region (): Commands For Killing.
@@ -13251,7 +13283,7 @@ D.4 Function Index
* kill-word (M-d): Commands For Killing.
(line 23)
* magic-space (): Miscellaneous Commands.
(line 129)
(line 130)
* menu-complete (): Commands For Completion.
(line 28)
* menu-complete-backward (): Commands For Completion.
@@ -13431,7 +13463,7 @@ D.5 Concept Index
* installation: Basic Installation. (line 6)
* interaction, readline: Readline Interaction.
(line 6)
* interactive shell: Invoking Bash. (line 136)
* interactive shell: Invoking Bash. (line 137)
* interactive shell <1>: Interactive Shells. (line 6)
* internationalization: Locale Translation. (line 6)
* internationalized scripts: Creating Internationalized Scripts.
@@ -13444,7 +13476,7 @@ D.5 Concept Index
* killing text: Readline Killing Commands.
(line 6)
* localization: Locale Translation. (line 6)
* login shell: Invoking Bash. (line 133)
* login shell: Invoking Bash. (line 134)
* matching, pattern: Pattern Matching. (line 6)
* metacharacter: Definitions. (line 50)
* name: Definitions. (line 55)
@@ -13510,138 +13542,138 @@ D.5 Concept Index

Tag Table:
Node: Top904
Node: Introduction2848
Node: What is Bash?3064
Node: What is a shell?4200
Node: Definitions6813
Node: Basic Shell Features10143
Node: Shell Syntax11370
Node: Shell Operation12400
Node: Quoting13694
Node: Escape Character15035
Node: Single Quotes15573
Node: Double Quotes15925
Node: ANSI-C Quoting17273
Node: Locale Translation18670
Node: Creating Internationalized Scripts20076
Node: Comments24277
Node: Shell Commands25047
Node: Reserved Words25989
Node: Simple Commands26857
Node: Pipelines27522
Node: Lists30781
Node: Compound Commands32656
Node: Looping Constructs33668
Node: Conditional Constructs36190
Node: Command Grouping51129
Node: Coprocesses52624
Node: GNU Parallel55313
Node: Shell Functions56234
Node: Shell Parameters64689
Node: Positional Parameters69417
Node: Special Parameters70510
Node: Shell Expansions73974
Node: Brace Expansion76166
Node: Tilde Expansion78870
Node: Shell Parameter Expansion81828
Node: Command Substitution101591
Node: Arithmetic Expansion105123
Node: Process Substitution106139
Node: Word Splitting107250
Node: Filename Expansion109697
Node: Pattern Matching112963
Node: Quote Removal118689
Node: Redirections118996
Node: Executing Commands129227
Node: Simple Command Expansion129897
Node: Command Search and Execution132008
Node: Command Execution Environment134455
Node: Environment137906
Node: Exit Status139812
Node: Signals141873
Node: Shell Scripts146805
Node: Shell Builtin Commands150106
Node: Bourne Shell Builtins152220
Node: Bash Builtins178788
Node: Modifying Shell Behavior215239
Node: The Set Builtin215584
Node: The Shopt Builtin227541
Node: Special Builtins244596
Node: Shell Variables245588
Node: Bourne Shell Variables246025
Node: Bash Variables248536
Node: Bash Features287234
Node: Invoking Bash288251
Node: Bash Startup Files294680
Node: Interactive Shells299925
Node: What is an Interactive Shell?300336
Node: Is this Shell Interactive?301001
Node: Interactive Shell Behavior301828
Node: Bash Conditional Expressions305592
Node: Shell Arithmetic310806
Node: Aliases314138
Node: Arrays317275
Node: The Directory Stack324362
Node: Directory Stack Builtins325162
Node: Controlling the Prompt329610
Node: The Restricted Shell332498
Node: Bash POSIX Mode335383
Node: Shell Compatibility Mode353448
Node: Job Control362458
Node: Job Control Basics362918
Node: Job Control Builtins369199
Node: Job Control Variables375884
Node: Command Line Editing377118
Node: Introduction and Notation378824
Node: Readline Interaction381179
Node: Readline Bare Essentials382370
Node: Readline Movement Commands384181
Node: Readline Killing Commands385180
Node: Readline Arguments387206
Node: Searching388266
Node: Readline Init File390512
Node: Readline Init File Syntax391818
Node: Conditional Init Constructs418651
Node: Sample Init File423039
Node: Bindable Readline Commands426163
Node: Commands For Moving427704
Node: Commands For History430075
Node: Commands For Text435468
Node: Commands For Killing439596
Node: Numeric Arguments442387
Node: Commands For Completion443542
Node: Keyboard Macros449241
Node: Miscellaneous Commands449945
Node: Readline vi Mode456508
Node: Programmable Completion457488
Node: Programmable Completion Builtins466228
Node: A Programmable Completion Example477968
Node: Using History Interactively483316
Node: Bash History Facilities484000
Node: Bash History Builtins487738
Node: History Interaction494212
Node: Event Designators499165
Node: Word Designators500746
Node: Modifiers503053
Node: Installing Bash504993
Node: Basic Installation506112
Node: Compilers and Options509991
Node: Compiling For Multiple Architectures510744
Node: Installation Names512500
Node: Specifying the System Type514737
Node: Sharing Defaults515486
Node: Operation Controls516203
Node: Optional Features517225
Node: Reporting Bugs529608
Node: Major Differences From The Bourne Shell530969
Node: GNU Free Documentation License552392
Node: Indexes577572
Node: Builtin Index578026
Node: Reserved Word Index585127
Node: Variable Index587575
Node: Function Index604991
Node: Concept Index618989
Node: Top900
Node: Introduction2840
Node: What is Bash?3056
Node: What is a shell?4192
Node: Definitions6805
Node: Basic Shell Features10135
Node: Shell Syntax11362
Node: Shell Operation12392
Node: Quoting13686
Node: Escape Character15027
Node: Single Quotes15565
Node: Double Quotes15917
Node: ANSI-C Quoting17265
Node: Locale Translation18662
Node: Creating Internationalized Scripts20068
Node: Comments24269
Node: Shell Commands25039
Node: Reserved Words25981
Node: Simple Commands26849
Node: Pipelines27514
Node: Lists30773
Node: Compound Commands32648
Node: Looping Constructs33660
Node: Conditional Constructs36182
Node: Command Grouping51121
Node: Coprocesses52616
Node: GNU Parallel55305
Node: Shell Functions56226
Node: Shell Parameters64677
Node: Positional Parameters69582
Node: Special Parameters70675
Node: Shell Expansions74139
Node: Brace Expansion76331
Node: Tilde Expansion79680
Node: Shell Parameter Expansion82638
Node: Command Substitution102401
Node: Arithmetic Expansion105933
Node: Process Substitution106950
Node: Word Splitting108061
Node: Filename Expansion110508
Node: Pattern Matching113735
Node: Quote Removal119461
Node: Redirections119768
Node: Executing Commands130034
Node: Simple Command Expansion130704
Node: Command Search and Execution132815
Node: Command Execution Environment135262
Node: Environment138713
Node: Exit Status140619
Node: Signals142680
Node: Shell Scripts147612
Node: Shell Builtin Commands150913
Node: Bourne Shell Builtins153027
Node: Bash Builtins179594
Node: Modifying Shell Behavior216521
Node: The Set Builtin216866
Node: The Shopt Builtin228857
Node: Special Builtins245912
Node: Shell Variables246904
Node: Bourne Shell Variables247341
Node: Bash Variables249852
Node: Bash Features288674
Node: Invoking Bash289691
Node: Bash Startup Files296278
Node: Interactive Shells301523
Node: What is an Interactive Shell?301934
Node: Is this Shell Interactive?302599
Node: Interactive Shell Behavior303426
Node: Bash Conditional Expressions307190
Node: Shell Arithmetic312404
Node: Aliases315736
Node: Arrays318873
Node: The Directory Stack325968
Node: Directory Stack Builtins326768
Node: Controlling the Prompt331216
Node: The Restricted Shell334104
Node: Bash POSIX Mode336989
Node: Shell Compatibility Mode355053
Node: Job Control364063
Node: Job Control Basics364523
Node: Job Control Builtins370804
Node: Job Control Variables377489
Node: Command Line Editing378723
Node: Introduction and Notation380429
Node: Readline Interaction382784
Node: Readline Bare Essentials383975
Node: Readline Movement Commands385786
Node: Readline Killing Commands386785
Node: Readline Arguments388811
Node: Searching389871
Node: Readline Init File392117
Node: Readline Init File Syntax393423
Node: Conditional Init Constructs420251
Node: Sample Init File424639
Node: Bindable Readline Commands427762
Node: Commands For Moving429303
Node: Commands For History431674
Node: Commands For Text437067
Node: Commands For Killing441195
Node: Numeric Arguments443986
Node: Commands For Completion445141
Node: Keyboard Macros450840
Node: Miscellaneous Commands451544
Node: Readline vi Mode458114
Node: Programmable Completion459094
Node: Programmable Completion Builtins467834
Node: A Programmable Completion Example479574
Node: Using History Interactively484922
Node: Bash History Facilities485606
Node: Bash History Builtins489344
Node: History Interaction495818
Node: Event Designators500771
Node: Word Designators502352
Node: Modifiers504659
Node: Installing Bash506599
Node: Basic Installation507718
Node: Compilers and Options511597
Node: Compiling For Multiple Architectures512350
Node: Installation Names514106
Node: Specifying the System Type516343
Node: Sharing Defaults517092
Node: Operation Controls517809
Node: Optional Features518831
Node: Reporting Bugs531214
Node: Major Differences From The Bourne Shell532574
Node: GNU Free Documentation License553997
Node: Indexes579177
Node: Builtin Index579631
Node: Reserved Word Index586732
Node: Variable Index589180
Node: Function Index606596
Node: Concept Index620594

End Tag Table
+64 -39
View File
@@ -1,12 +1,12 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=etex 2024.4.9) 13 DEC 2024 09:15
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=pdfetex 2024.4.9) 8 JAN 2025 09:33
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\nonstopmode \input /usr/local/src/bash/bash-20241207/doc/bashref.texi \input
/usr/local/src/bash/bash-20241207/doc/bashref.texi
(/usr/local/src/bash/bash-20241207/doc/bashref.texi
(/usr/local/src/bash/bash-20241207/doc/texinfo.tex
**\input /usr/local/src/bash/bash-20241227/doc/bashref.texi \input /usr/local/s
rc/bash/bash-20241227/doc/bashref.texi
(/usr/local/src/bash/bash-20241227/doc/bashref.texi
(/usr/local/src/bash/bash-20241227/doc/texinfo.tex
Loading texinfo [version 2015-11-22.14]:
\outerhsize=\dimen16
\outervsize=\dimen17
@@ -162,20 +162,23 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
texinfo.tex: doing @include of version.texi
(/usr/local/src/bash/bash-20241207/doc/version.texi) [1] [2]
(/usr/local/build/bash/bash-20241207/doc/bashref.toc [-1] [-2] [-3]) [-4]
Chapter 1
(/usr/local/src/bash/bash-20241227/doc/version.texi) [1{/opt/local/var/db/texmf
/fonts/map/pdftex/updmap/pdftex.map}] [2]
(/usr/local/build/bash/bash-20241227/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20241227/doc/bashref.toc)
(/usr/local/build/bash/bash-20241227/doc/bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
(/usr/local/build/bash/bash-20241207/doc/bashref.aux)
(/usr/local/build/bash/bash-20241227/doc/bashref.aux)
\openout1 = `bashref.aux'.
[1] Chapter 2
[2]
[1] Chapter 2 [2]
@cpindfile=@write2
\openout2 = `bashref.cp'.
[3] Chapter 3 [4] [5] [6] [7]
[3] Chapter 3 [4] [5] [6] [7]
@vrindfile=@write3
\openout3 = `bashref.vr'.
@@ -219,16 +222,17 @@ Overfull \hbox (5.95723pt too wide) in paragraph at lines 744--745
@rwindfile=@write4
\openout4 = `bashref.rw'.
[10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23]
[24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38]
[39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] Chapter 4 [50]
[10] [11] [12] [13] [14] [15] [16] [17] [18] [19{/opt/local/share/texmf-texliv
e/fonts/enc/dvips/cm-super/cm-super-t1.enc}] [20] [21] [22] [23] [24]
[25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39]
[40] [41] [42] [43] [44] [45] [46] [47] [48] [49] Chapter 4 [50]
@btindfile=@write5
\openout5 = `bashref.bt'.
[51]
[52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
[67] [68] [69] [70] [71]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5773--5773
[51] [52]
[53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67]
[68] [69] [70] [71] [72]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5845--5845
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -241,7 +245,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5773--5773
.etc.
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5774--5774
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5846--5846
[]@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -253,17 +257,17 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5774--5774
.@texttt t
.etc.
[72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] Chapter 5 [84]
[85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] Chapter 6
[98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110]
[111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] Chapter 7
[122] [123] [124] [125] [126]
[73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] Chapter 5 [84] [85]
[86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] Chapter 6 [98]
[99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111]
[112] [113] [114] [115] [116] [117] [118] [119] [120] [121] Chapter 7 [122]
[123] [124] [125] [126]
texinfo.tex: doing @include of rluser.texi
(/usr/local/src/bash/bash-20241207/lib/readline/doc/rluser.texi Chapter 8
(/usr/local/src/bash/bash-20241227/lib/readline/doc/rluser.texi Chapter 8
[127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138]
Underfull \hbox (badness 7540) in paragraph at lines 963--969
Underfull \hbox (badness 7540) in paragraph at lines 964--970
[]@textrm In the ex-am-ple above, @textttsl C-u[] @textrm is bound to the func
-tion
@@ -276,7 +280,7 @@ Underfull \hbox (badness 7540) in paragraph at lines 963--969
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 963--969
Underfull \hbox (badness 10000) in paragraph at lines 964--970
@texttt universal-argument[]@textrm , @textttsl M-DEL[] @textrm is bound to th
e func-tion
@@ -289,7 +293,7 @@ e func-tion
.etc.
[139] [140] [141] [142]
Overfull \hbox (26.43913pt too wide) in paragraph at lines 1209--1209
Overfull \hbox (26.43913pt too wide) in paragraph at lines 1210--1210
[]@texttt Meta-Control-h: backward-kill-word Text after the function name is i
gnored[]
@@ -310,10 +314,10 @@ gnored[]
texinfo.tex: doing @include of hsuser.texi
(/usr/local/src/bash/bash-20241207/lib/readline/doc/hsuser.texi Chapter 9
(/usr/local/src/bash/bash-20241227/lib/readline/doc/hsuser.texi Chapter 9
[165] [166] [167] [168] [169] [170] [171]) Chapter 10 [172] [173] [174]
[175] [176]
Underfull \hbox (badness 10000) in paragraph at lines 10464--10473
Underfull \hbox (badness 10000) in paragraph at lines 10581--10590
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
@@ -326,7 +330,7 @@ entation[]@textrm '[],
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 10464--10473
Underfull \hbox (badness 10000) in paragraph at lines 10581--10590
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
@@ -343,16 +347,37 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
texinfo.tex: doing @include of fdl.texi
(/usr/local/src/bash/bash-20241207/doc/fdl.texi [190] [191] [192] [193]
(/usr/local/src/bash/bash-20241227/doc/fdl.texi [190] [191] [192] [193]
[194] [195] [196]) Appendix D [197] [198] [199] [200] [201] [202] [203]
[204] [205] [206] )
Here is how much of TeX's memory you used:
3531 strings out of 495850
40273 string characters out of 6172145
88583 words of memory out of 5000000
4879 multiletter control sequences out of 15000+600000
4114 strings out of 495840
47656 string characters out of 6171739
145117 words of memory out of 5000000
5048 multiletter control sequences out of 15000+600000
34315 words of font info for 116 fonts, out of 8000000 for 9000
701 hyphenation exceptions out of 8191
16i,6n,16p,402b,942s stack positions out of 10000i,1000n,20000p,200000b,200000s
16i,6n,16p,389b,983s stack positions out of 10000i,1000n,20000p,200000b,200000s
</opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/
cm/cmbx12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cm
csc10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi10
.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi12.pfb>
</opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi9.pfb></opt/
local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr10.pfb></opt/local/
share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr9.pfb></opt/local/share/t
exmf-texlive/fonts/type1/public/amsfonts/cm/cmsl10.pfb></opt/local/share/texmf-
texlive/fonts/type1/public/amsfonts/cm/cmsltt10.pfb></opt/local/share/texmf-tex
live/fonts/type1/public/amsfonts/cm/cmsy10.pfb></opt/local/share/texmf-texlive/
fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/share/texmf-texlive/fonts
/type1/public/amsfonts/cm/cmtt10.pfb></opt/local/share/texmf-texlive/fonts/type
1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf-texlive/fonts/type1/pub
lic/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm
-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm-super
/sfrm1440.pfb>
Output written on bashref.pdf (212 pages, 850992 bytes).
PDF statistics:
2938 PDF objects out of 2984 (max. 8388607)
2678 compressed objects within 27 object streams
340 named destinations out of 1000 (max. 500000)
1157 words of extra memory for PDF output out of 10000 (max. 10000000)
Output written on bashref.dvi (212 pages, 889260 bytes).
BIN
View File
Binary file not shown.
+230 -117
View File
@@ -14,7 +14,7 @@ This is Edition @value{EDITION}, last updated @value{UPDATED},
of @cite{The GNU Bash Reference Manual},
for @code{Bash}, Version @value{VERSION}.
Copyright @copyright{} 1988--2024 Free Software Foundation, Inc.
Copyright @copyright{} 1988--2025 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -1719,7 +1719,7 @@ until it is reset in that scope or until the function returns.
Once the function returns, any instance of the variable at a previous
scope becomes visible.
If the unset acts on a variable at a previous scope, any instance of a
variable with that name that had been shadowed will become visible
variable with that name that had been shadowed becomes visible
(see below how the @code{localvar_unset} shell option changes this behavior).
The @option{-f} option to the @code{declare} (@code{typeset})
@@ -1796,23 +1796,26 @@ command export var=value
@end example
In the context where an assignment statement is assigning a value
to a shell variable or array index (@pxref{Arrays}),
the @samp{+=} operator appends to or adds to
to a shell variable or array index (@pxref{Arrays}), the
@samp{+=} operator appends to or adds to
the variable's previous value.
This includes arguments to declaration commands such as
@code{declare} that accept assignment statements.
When @samp{+=} is applied to a variable
for which the @code{integer} attribute has been set,
@code{declare}
that accept assignment statements.
When @samp{+=}
is applied to a variable for which the
@code{integer} attribute has been set,
the variable's current value and @var{value} are each evaluated as
arithmetic expressions,
and the sum of the results is assigned as the variable's value.
The current value is usually an integer constant, but may be an expression.
When @samp{+=} is applied to an array variable using compound assignment
(@pxref{Arrays}), the
variable's value is not unset (as it is when using @samp{=}), and new
values are appended to the array beginning at one greater than the array's
maximum index (for indexed arrays), or added as additional key-value pairs
in an associative array.
When @samp{+=}
is applied to an array variable using compound assignment (@pxref{Arrays}),
the variable's value is not unset
(as it is when using @samp{=}),
and new values are appended to the array
beginning at one greater than the array's maximum index (for indexed arrays),
or added as additional key-value pairs in an associative array.
When applied to a string-valued variable, @var{value} is expanded and
appended to the variable's value.
@@ -2045,12 +2048,13 @@ This mechanism is similar to
@dfn{filename expansion} (@pxref{Filename Expansion}),
but the filenames generated need not exist.
Patterns to be brace expanded are formed from an optional @var{preamble},
followed by either a series of comma-separated strings or a sequence expression
between a pair of braces,
followed by an optional @var{postscript}.
The preamble is prefixed to each string contained within the braces, and
the postscript is then appended to each resulting string, expanding left
to right.
followed by either a series of comma-separated strings or
a sequence expression between a pair of braces,
followed by an optional
@var{postscript}.
The preamble is prefixed to each string contained within the braces,
and the postscript is then appended to each resulting string,
expanding left to right.
Brace expansions may be nested.
The results of each expanded string are not sorted;
@@ -2061,7 +2065,8 @@ bash$ echo a@{d,c,b@}e
ade ace abe
@end example
A sequence expression takes the form @code{@{@var{x}..@var{y}[..@var{incr}]@}},
A sequence expression takes the form
@code{@{@var{x}..@var{y}[..@var{incr}]@}},
where @var{x} and @var{y} are either integers or letters,
and @var{incr}, an optional increment, is an integer.
When integers are supplied, the expression expands to each number between
@@ -2090,11 +2095,13 @@ and closing braces, and at least one unquoted comma or a valid
sequence expression.
Any incorrectly formed brace expansion is left unchanged.
A @{ or @samp{,} may be quoted with a backslash to prevent its
A @samp{@{} or @samp{,}
may be quoted with a backslash to prevent its
being considered part of a brace expression.
To avoid conflicts with parameter expansion, the string @samp{$@{}
is not considered eligible for brace expansion,
and inhibits brace expansion until the closing @samp{@}}.
and inhibits brace expansion until the closing
@samp{@}}.
This construct is typically used as shorthand when the common
prefix of the strings to be generated is longer than in the
@@ -2107,6 +2114,38 @@ or
chown root /usr/@{ucb/@{ex,edit@},lib/@{ex?.?*,how_ex@}@}
@end example
Brace expansion introduces a slight incompatibility with
historical versions of
@command{sh}.
@command{sh}
does not treat opening or closing braces specially when they
appear as part of a word, and preserves them in the output.
Bash
removes braces from words as a consequence of brace
expansion.
For example, a word entered to
@command{sh}
as
@samp{file@{1,2@}}
appears identically in the output.
Bash
outputs that word as
@samp{file1 file2}
after brace expansion.
Start
Bash
with the
@option{+B}
option or disable brace expansion with the
@option{+B}
option to the
@code{set}
command
(@pxref{Shell Builtin Commands})
for strict
@command{sh}
compatibility.
@node Tilde Expansion
@subsection Tilde Expansion
@cindex tilde expansion
@@ -2838,7 +2877,7 @@ word splitting and filename expansion on the results.
@cindex expansion, arithmetic
@cindex arithmetic expansion
Arithmetic expansion evalutes an arithmetic expression
Arithmetic expansion evaluates an arithmetic expression
and substitutes the result.
The format for arithmetic expansion is:
@@ -2884,8 +2923,9 @@ This filename is
passed as an argument to the current command as the result of the
expansion.
If the @code{>(@var{list})} form is used, writing to
the file provides input for @var{list}.
If the
@code{>(@var{list})} form is used, writing to the file
provides input for @var{list}.
If the
@code{<(@var{list})} form is used, reading the file
obtains the output of @var{list}.
@@ -3018,23 +3058,25 @@ The filenames
@file{.} and @file{..}
are always ignored when @env{GLOBIGNORE}
is set and not null.
However, setting @env{GLOBIGNORE} to a non-null value has the effect of
enabling the @code{dotglob}
However, setting @env{GLOBIGNORE}
to a non-null value has the effect of enabling the
@code{dotglob}
shell option, so all other filenames beginning with a
@samp{.}
match.
To get the old behavior of ignoring filenames beginning with a
@samp{.}, make @samp{.*} one of the patterns in @env{GLOBIGNORE}.
@samp{.},
make @samp{.*} one of the patterns in @env{GLOBIGNORE}.
The @code{dotglob} option is disabled when @env{GLOBIGNORE}
is unset.
The @code{GLOBIGNORE}
pattern matching honors the setting of the @code{extglob} shell
option.
After the pattern is expanded and matched against filenames, the value of the
@env{GLOBSORT} shell
variable controls how the results are sorted, as described
below (@pxref{Bash Variables}).
The value of the
@env{GLOBSORT}
shell variable controls how the results of pathname expansion are sorted,
as described below (@pxref{Bash Variables}).
@node Pattern Matching
@subsubsection Pattern Matching
@@ -3095,7 +3137,9 @@ force the use of the C locale by setting the @env{LC_COLLATE} or
Within a bracket expression, @dfn{character classes} can be specified
using the syntax
@code{[:}@var{class}@code{:]}, where @var{class} is one of the
following classes defined in the @sc{posix} standard:
following classes defined in the
@sc{posix}
standard:
@example
alnum alpha ascii blank cntrl digit graph lower
print punct space upper word xdigit
@@ -3325,17 +3369,20 @@ and the
@code{noclobber}
option to the
@code{set}
builtin has been enabled, the redirection fails if the file
builtin command has been enabled, the redirection fails if the file
whose name results from the expansion of @var{word} exists and is
a regular file.
If the redirection operator is @samp{>|}, or the redirection operator is
@samp{>} and the @code{noclobber} option is not enabled,
Bash attemps the redirection
If the redirection operator is @samp{>|},
or the redirection operator is @samp{>} and
the @code{noclobber} option to the @code{set}
builtin is not enabled,
Bash attempts the redirection
even if the file named by @var{word} exists.
@subsection Appending Redirected Output
Redirecting output in this fashion opens
the file whose name results from the expansion of @var{word}
the file whose name results from the expansion of
@var{word}
for appending on file descriptor @var{n},
or the standard output (file descriptor 1) if @var{n}
is not specified.
@@ -4606,7 +4653,9 @@ commands sort lexicographically using ASCII ordering.
The historical operator-precedence parsing with 4 or more arguments can
lead to ambiguities when it encounters strings that look like primaries.
The @sc{posix} standard has deprecated the @option{-a} and @option{-o}
The
@sc{posix}
standard has deprecated the @option{-a} and @option{-o}
primaries and enclosing expressions within parentheses.
Scripts should no longer use them.
It's much more reliable to restrict test invocations to a single primary,
@@ -4643,7 +4692,7 @@ The @var{action} is a command that is read and executed when the
shell receives any of the signals @var{sigspec}.
If @var{action} is absent (and
there is a single @var{sigspec}) or
equal to @samp{-}, each specified @var{sigspec}'ss disposition is reset
equal to @samp{-}, each specified @var{sigspec}'s disposition is reset
to the value it had when the shell was started.
If @var{action} is the null string, then the signal specified by
each @var{sigspec} is ignored by the shell and commands it invokes.
@@ -4907,7 +4956,7 @@ If the separator is a colon, any enclosing double quotes are optional, and
Readline does not expand the command string before saving it.
Since the entire key binding expression must be a single argument, it
should be enclosed in single quotes.
When @var{shell-command} is executed, the shell sets thex
When @var{shell-command} is executed, the shell sets the
@code{READLINE_LINE} variable to the contents of the Readline line
buffer
and the
@@ -5194,7 +5243,9 @@ The @option{-n} option means to print only disabled builtins.
The @option{-a} option means to list
each builtin with an indication of whether or not it is enabled.
The @option{-s} option means to
restrict @code{enable} to the @sc{posix} special builtins.
restrict @code{enable} to the
@sc{posix}
special builtins.
The @option{-f} option means to load the new builtin command @var{name}
from shared object @var{filename}, on systems that support dynamic loading.
@@ -5204,8 +5255,9 @@ colon-separated list of directories in which to search for @var{filename}.
The default for @env{BASH_LOADABLES_PATH} is system-dependent,
and may include "." to force a search of the current directory.
The @option{-d} option will delete a builtin loaded with @option{-f}.
If @option{-s} is used with @option{-f}, the new builtin becomes
a special builtin (@pxref{Special Builtins}).
If @option{-s} is used with @option{-f}, the new builtin becomes a
@sc{posix}
special builtin (@pxref{Special Builtins}).
If no options are supplied and a @var{name} is not a shell builtin,
@code{enable} will attempt to load @var{name} from a shared object named
@@ -5223,8 +5275,10 @@ help [-dms] [@var{pattern}]
Display helpful information about builtin commands.
If @var{pattern} is specified, @code{help} gives detailed help
on all commands matching @var{pattern}, otherwise it displays
a list of all builtins and shell compound commands.
on all commands matching @var{pattern}
as described below;
otherwise it displays a list of
all builtins and shell compound commands.
Options, if supplied, have the following meanings:
@@ -5237,6 +5291,18 @@ Display the description of each @var{pattern} in a manpage-like format
Display only a short usage synopsis for each @var{pattern}
@end table
If @var{pattern} contains pattern matching characters
(@pxref{Pattern Matching})
it's treated as a shell pattern and
@code{help} prints the description of each
help topic matching @var{pattern}.
If not, and @var{pattern} exactly matches the name of a help topic,
@code{help} prints the description
associated with that topic.
Otherwise, @code{help} performs prefix matching and
prints the descriptions of all matching help topics.
The return status is zero unless no command matches @var{pattern}.
@item let
@@ -5680,7 +5746,9 @@ allow this value to be set).
The pipe buffer size.
@item -q
The maximum number of bytes in @sc{posix} message queues.
The maximum number of bytes in
@sc{posix}
message queues.
@item -r
The maximum real-time scheduling priority.
@@ -5736,7 +5804,7 @@ Values are in 1024-byte increments, except for
@option{-b},
@option{-k},
@option{-n} and @option{-u}, which are unscaled values;
and, when in @sc{posix} Mode (@pxref{Bash POSIX Mode}),
and, when in @sc{posix} mode (@pxref{Bash POSIX Mode}),
@option{-c} and @option{-f}, which are in 512-byte increments.
The return status is zero unless an invalid option or argument is supplied,
@@ -5944,7 +6012,8 @@ commands in the pipeline exit successfully.
This option is disabled by default.
@item posix
Change the behavior of Bash where the default operation differs
Enable @sc{posix} mode;
change the behavior of Bash where the default operation differs
from the @sc{posix} standard to match the standard
(@pxref{Bash POSIX Mode}).
This is intended to make Bash behave as a strict superset of that
@@ -6867,9 +6936,9 @@ being closed.
@item CHILD_MAX
Set the number of exited child status values for the shell to remember.
Bash will not allow this value to be decreased below a @sc{posix}-mandated
minimum, and there is a maximum value (currently 8192) that this may
not exceed.
Bash will not allow this value to be decreased below a
@sc{posix}-mandated minimum,
and there is a maximum value (currently 8192) that this may not exceed.
The minimum value is system-dependent.
@item COLUMNS
@@ -6966,7 +7035,7 @@ running in an Emacs shell buffer and disables line editing.
Expanded and executed similarly to @code{BASH_ENV}
(@pxref{Bash Startup Files})
when an interactive shell is invoked in
@sc{posix} Mode (@pxref{Bash POSIX Mode}).
@sc{posix} mode (@pxref{Bash POSIX Mode}).
@item EPOCHREALTIME
Each time this parameter is referenced, it expands to the number of seconds
@@ -7119,14 +7188,19 @@ quick substitution, and tokenization
The first character is the @dfn{history expansion} character,
the character which begins a history expansion, normally
@samp{!}.
The second character is the ``quick substitution'' character, normally
The second character is the
@dfn{quick substitution}
character, normally
@samp{^}.
When it appears as the first character on the line,
history substitution repeats the previous command,
replacing one string with another.
The optional third character is the character which indicates that
the remainder of the line is a comment when found as the first character
of a word, usually @samp{#}.
The optional third character is the
@dfn{history comment}
character, normally @samp{#},
which indicates
that the remainder of the line is a comment
when it appears as the first character of a word.
The history comment character disables history substitution
for the remaining words on the line.
It does not necessarily cause the shell parser to treat the rest of the
@@ -7436,24 +7510,27 @@ is unset, it loses its special properties, even if it is
subsequently reset.
@item READLINE_ARGUMENT
Any numeric argument given to a Readline command that was defined using
Any numeric argument given to a Readline
command that was defined using
@samp{bind -x} (@pxref{Bash Builtins}
when it was invoked.
@item READLINE_LINE
The contents of the Readline line buffer, for use
with @samp{bind -x} (@pxref{Bash Builtins}).
The contents of the Readline
line buffer, for use with
@samp{bind -x} (@pxref{Bash Builtins}).
@item READLINE_MARK
The position of the @dfn{mark} (saved insertion point) in the
Readline line buffer, for use
The position of the @dfn{mark} (saved insertion point) in the Readline
line buffer, for use
with @samp{bind -x} (@pxref{Bash Builtins}).
The characters between the insertion point and the mark are often
called the @dfn{region}.
@item READLINE_POINT
The position of the insertion point in the Readline line buffer, for use
with @samp{bind -x} (@pxref{Bash Builtins}).
The position of the insertion point in the Readline
line buffer, for use with
@samp{bind -x} (@pxref{Bash Builtins}).
@item REPLY
The default variable for the @code{read} builtin;
@@ -7485,6 +7562,8 @@ as @samp{on} by @samp{set -o}.
If this variable is in the environment when Bash
starts up, the shell enables each option in the list before
reading any startup files.
If this variable is exported, child shells will enable each option
in the list.
This variable is readonly.
@item SHLVL
@@ -7659,8 +7738,11 @@ interactive shell.
This is on by default if the shell is invoked as @code{sh}.
@item --posix
Change the behavior of Bash where the default operation differs
from the @sc{posix} standard to match the standard.
Enable @sc{posix} mode;
change the behavior of Bash
where the default operation differs from the
@sc{posix}
standard to match the standard.
This is intended to make Bash behave as a strict superset of that
standard.
@xref{Bash POSIX Mode}, for a description of the Bash @sc{posix} mode.
@@ -7748,21 +7830,23 @@ Equivalent to @code{--}.
@end table
@cindex login shell
A @emph{login} shell is one whose first character of argument zero is
A @dfn{login shell} is one whose first character of argument zero is
@samp{-}, or one invoked with the @option{--login} option.
@cindex interactive shell
An @emph{interactive} shell is one started without non-option arguments,
unless @option{-s} is specified, without specifying the @option{-c} option,
and whose input and output (using the standard error) are both
connected to terminals (as determined by @code{isatty(3)}), or one
started with the @option{-i} option.
An @dfn{interactive shell} is one started without non-option arguments,
unless @option{-s} is specified,
without specifying the @option{-c} option,
and whose standard input and standard error are both
connected to terminals (as determined by
@i{isatty(3)}),
or one started with the @option{-i} option.
@xref{Interactive Shells}, for more information.
If arguments remain after option processing, and neither the
@option{-c} nor the @option{-s}
option has been supplied, the first argument is assumed to
be the name of a file containing shell commands (@pxref{Shell Scripts}).
option has been supplied, the first argument is treated as
the name of a file containing shell commands (@pxref{Shell Scripts}).
When Bash is invoked in this fashion, @code{$0}
is set to the name of the file, and the positional parameters
are set to the remaining arguments.
@@ -7770,6 +7854,11 @@ Bash reads and executes commands from this file, then exits.
Bash's exit status is the exit status of the last command executed
in the script.
If no commands are executed, the exit status is 0.
Bash
first attempts to open the file in the current directory,
and, if no file is found, searches the directories in
@env{PATH}
for the script.
@node Bash Startup Files
@section Bash Startup Files
@@ -7830,39 +7919,48 @@ but does not the value of the @env{PATH} variable to search for the
filename.
As noted above, if a non-interactive shell is invoked with the
@option{--login} option, Bash attempts to read and execute commands from the
@option{--login} option,
Bash attempts to read and execute commands from the
login shell startup files.
@subsubheading Invoked with name @code{sh}
If Bash is invoked with the name @code{sh}, it tries to mimic the
startup behavior of historical versions of @code{sh} as closely as
possible, while conforming to the @sc{posix} standard as well.
If Bash is invoked with the name @command{sh},
it tries to mimic the startup behavior of historical versions of
@command{sh} as closely as possible,
while conforming to the
@sc{posix}
standard as well.
When invoked as an interactive login shell, or as a non-interactive
shell with the @option{--login} option, it first attempts to read
and execute commands from @file{/etc/profile} and @file{~/.profile}, in
that order.
and execute commands from
@file{/etc/profile} and @file{~/.profile},
in that order.
The @option{--noprofile} option inhibits this behavior.
When invoked as an interactive shell with the name @code{sh}, Bash
looks for the variable @env{ENV}, expands its value if it is defined,
and uses the expanded value as the name of a file to read and execute.
Since a shell invoked as @code{sh} does not attempt to read and execute
commands from any other startup files, the @option{--rcfile} option has
no effect.
When invoked as an interactive shell with the name @command{sh}, Bash
looks for the variable @env{ENV},
expands its value if it is defined, and uses the
expanded value as the name of a file to read and execute.
Since a shell invoked as @command{sh}
does not attempt to read and execute commands from any other startup
files, the
@option{--rcfile}
option has no effect.
A non-interactive shell invoked with the name @code{sh} does not attempt
to read any other startup files.
A non-interactive shell invoked with the name @command{sh}
does not attempt to read any other startup files.
When invoked as @code{sh}, Bash enters @sc{posix} mode after reading
When invoked as @command{sh}, Bash enters @sc{posix} mode after reading
the startup files.
@subsubheading Invoked in @sc{posix} mode
When Bash is started in @sc{posix} mode, as with the
@option{--posix} command line option, it follows the @sc{posix} standard
for startup files.
@option{--posix} command line option, it follows the
@sc{posix}
standard for startup files.
In this mode, interactive shells expand the @env{ENV} variable
and read and execute commands from the file whose name is the
expanded value.
@@ -7870,14 +7968,17 @@ No other startup files are read.
@subsubheading Invoked by remote shell daemon
Bash attempts to determine when it is being run with its standard input
Bash
attempts to determine when it is being run with its standard input
connected to a network connection, as when executed by
the historical and rarely-seen remote shell daemon, usually @code{rshd},
or the secure shell daemon @code{sshd}.
If Bash
If
Bash
determines it is being run non-interactively in this fashion,
it reads and executes commands from @file{~/.bashrc}, if that
file exists and is readable.
it reads and executes commands from
@file{~/.bashrc},
if that file exists and is readable.
Bash does not read this file if invoked as @code{sh}.
The
@option{--norc}
@@ -8212,7 +8313,9 @@ True if the strings are equal.
When used with the @code{[[} command, this performs pattern matching as
described above (@pxref{Conditional Constructs}).
@samp{=} should be used with the @code{test} command for @sc{posix} conformance.
@samp{=} should be used with the @code{test} command for
@sc{posix}
conformance.
@item @var{string1} != @var{string2}
True if the strings are not equal.
@@ -8446,7 +8549,8 @@ There is no maximum
limit on the size of an array, nor any requirement that members
be indexed or assigned contiguously.
Indexed arrays are referenced using arithmetic expressions
that must expand to an integer (@pxref{Shell Arithmetic})) and are zero-based;
that must expand to an integer (@pxref{Shell Arithmetic}))
and are zero-based;
associative arrays use arbitrary strings.
Unless otherwise noted, indexed array indices must be non-negative integers.
@@ -8460,7 +8564,7 @@ using the syntax
The @var{subscript}
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero.
To explicitly declare an array, use
To explicitly declare an indexed array, use
@example
declare -a @var{name}
@end example
@@ -8479,9 +8583,8 @@ Associative arrays are created using
declare -A @var{name}
@end example
Attributes may be
specified for an array variable using the @code{declare} and
@code{readonly} builtins.
Attributes may be specified for an array variable using the
@code{declare} and @code{readonly} builtins.
Each attribute applies to all members of an array.
Arrays are assigned using compound assignments of the form
@@ -8529,8 +8632,10 @@ interpreted as relative to one greater than the maximum index of
@var{name}, so negative indices count back from the end of the
array, and an index of -1 references the last element.
The @samp{+=} operator appends to an array variable when assigning
using the compound assignment syntax; see @ref{Shell Parameters} above.
The @samp{+=}
operator appends to an array variable when assigning
using the compound assignment syntax; see
@ref{Shell Parameters} above.
An array element is referenced using
@code{$@{@var{name}[@var{subscript}]@}}.
@@ -8936,7 +9041,8 @@ such as @code{jails}, @code{zones}, or @code{containers}.
@subsection What is POSIX?
@cindex POSIX description
@sc{posix} is the name for a family of standards based on Unix.
@sc{posix}
is the name for a family of standards based on Unix.
A number of Unix services, tools, and functions are part of the standard,
ranging from the basic system calls and C library functions to common
applications and tools to system administration and management.
@@ -8968,11 +9074,11 @@ The @i{special} builtins, which must be implemented as part of the
shell to provide the desired functionality, are specified as
being part of the shell; examples of these are @code{eval} and
@code{export}.
Other utilities appear in the sections of POSIX not
Other utilities appear in the sections of @sc{posix} not
devoted to the shell which are commonly (and in some cases must
be) implemented as builtin commands, such as
@code{read} and @code{test}.
POSIX also specifies aspects of the shell's interactive
@sc{posix} also specifies aspects of the shell's interactive
behavior, including job control and command
line editing.
Only vi-style line editing commands have been standardized;
@@ -8985,7 +9091,7 @@ Although Bash is an implementation of the @sc{posix} shell
specification, there are areas where the Bash default behavior
differs from the specification.
The Bash @dfn{posix mode} changes the Bash
behavior in these areas so that it conforms more closely
behavior in these areas so that it conforms more strictly
to the standard.
Starting Bash with the @option{--posix} command-line option or executing
@@ -8996,7 +9102,7 @@ match that specified by @sc{posix} in areas where the Bash default differs.
When invoked as @code{sh}, Bash enters @sc{posix} mode after reading the
startup files.
The following list is what's changed when `@sc{posix} mode' is in effect:
The following list is what's changed when @sc{posix} mode is in effect:
@enumerate
@item
@@ -9505,14 +9611,18 @@ strcoll(3).
@item compat41
@itemize @bullet
@item
In posix mode, @code{time} may be followed by options and still be
recognized as a reserved word (this is @sc{posix} interpretation 267).
In @sc{posix} mode, @code{time} may be followed by options and still be
recognized as a reserved word (this is
@sc{posix}
interpretation 267).
@item
In posix mode, the parser requires that an even number of single
In @sc{posix} mode, the parser requires that an even number of single
quotes occur in the @var{word} portion of a double-quoted $@{@dots{}@}
parameter expansion and treats them specially, so that characters within
the single quotes are considered quoted
(this is @sc{posix} interpretation 221).
(this is
@sc{posix}
interpretation 221).
@end itemize
@item compat42
@@ -9521,10 +9631,12 @@ the single quotes are considered quoted
The replacement string in double-quoted pattern substitution does not
undergo quote removal, as it does in versions after bash-4.2.
@item
In posix mode, single quotes are considered special when expanding
In @sc{posix} mode, single quotes are considered special when expanding
the @var{word} portion of a double-quoted $@{@dots{}@} parameter expansion
and can be used to quote a closing brace or other special character
(this is part of @sc{posix} interpretation 221);
(this is part of
@sc{posix}
interpretation 221);
in later versions, single quotes
are not special within double-quoted word expansions.
@end itemize
@@ -9533,7 +9645,7 @@ are not special within double-quoted word expansions.
@itemize @bullet
@item
Word expansion errors are considered non-fatal errors that cause the
current command to fail, even in posix mode
current command to fail, even in @sc{posix} mode
(the default behavior is to make them fatal errors that cause the shell
to exit).
@item
@@ -9556,7 +9668,8 @@ Bash-5.0 and later reset the loop state to prevent the exit.
@item
Variable assignments preceding builtins like @code{export} and @code{readonly}
that set attributes continue to affect variables with the same
name in the calling environment even if the shell is not in posix
name in the calling environment even if the shell is not in
@sc{posix}
mode.
@end itemize
@@ -10700,7 +10813,7 @@ The hardware and operating system.
@item
The compiler used to compile Bash.
@item
A description of the bug behaviour.
A description of the bug behavior.
@item
A short script or `recipe' which exercises the bug and may be used
to reproduce it.
+6 -6
View File
@@ -33,13 +33,13 @@
@numsubsecentry{Shell Parameter Expansion}{3.5.3}{Shell Parameter Expansion}{27}
@numsubsecentry{Command Substitution}{3.5.4}{Command Substitution}{35}
@numsubsecentry{Arithmetic Expansion}{3.5.5}{Arithmetic Expansion}{36}
@numsubsecentry{Process Substitution}{3.5.6}{Process Substitution}{36}
@numsubsecentry{Process Substitution}{3.5.6}{Process Substitution}{37}
@numsubsecentry{Word Splitting}{3.5.7}{Word Splitting}{37}
@numsubsecentry{Filename Expansion}{3.5.8}{Filename Expansion}{37}
@numsubsecentry{Filename Expansion}{3.5.8}{Filename Expansion}{38}
@numsubsubsecentry{Pattern Matching}{3.5.8.1}{Pattern Matching}{38}
@numsubsecentry{Quote Removal}{3.5.9}{Quote Removal}{40}
@numsecentry{Redirections}{3.6}{Redirections}{40}
@numsubsecentry{Redirecting Input}{3.6.1}{}{41}
@numsubsecentry{Redirecting Input}{3.6.1}{}{42}
@numsubsecentry{Redirecting Output}{3.6.2}{}{42}
@numsubsecentry{Appending Redirected Output}{3.6.3}{}{42}
@numsubsecentry{Redirecting Standard Output and Standard Error}{3.6.4}{}{42}
@@ -53,7 +53,7 @@
@numsubsecentry{Simple Command Expansion}{3.7.1}{Simple Command Expansion}{44}
@numsubsecentry{Command Search and Execution}{3.7.2}{Command Search and Execution}{45}
@numsubsecentry{Command Execution Environment}{3.7.3}{Command Execution Environment}{45}
@numsubsecentry{Environment}{3.7.4}{Environment}{46}
@numsubsecentry{Environment}{3.7.4}{Environment}{47}
@numsubsecentry{Exit Status}{3.7.5}{Exit Status}{47}
@numsubsecentry{Signals}{3.7.6}{Signals}{48}
@numsecentry{Shell Scripts}{3.8}{Shell Scripts}{49}
@@ -61,9 +61,9 @@
@numsecentry{Bourne Shell Builtins}{4.1}{Bourne Shell Builtins}{51}
@numsecentry{Bash Builtin Commands}{4.2}{Bash Builtins}{60}
@numsecentry{Modifying Shell Behavior}{4.3}{Modifying Shell Behavior}{72}
@numsubsecentry{The Set Builtin}{4.3.1}{The Set Builtin}{72}
@numsubsecentry{The Set Builtin}{4.3.1}{The Set Builtin}{73}
@numsubsecentry{The Shopt Builtin}{4.3.2}{The Shopt Builtin}{77}
@numsecentry{Special Builtins}{4.4}{Special Builtins}{83}
@numsecentry{Special Builtins}{4.4}{Special Builtins}{84}
@numchapentry{Shell Variables}{5}{Shell Variables}{85}
@numsecentry{Bourne Shell Variables}{5.1}{Bourne Shell Variables}{85}
@numsecentry{Bash Variables}{5.2}{Bash Variables}{86}
+267 -254
View File
@@ -226,7 +226,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
An argument of -- is converted to $$OOLLDDPPWWDD before attempting the
directory change.
If ccdd uses a non-empty directory name from CCDDPPAATTHH,, or if -- is
If ccdd uses a non-empty directory name from CCDDPPAATTHH, or if -- is
the first argument, and the directory change is successful, ccdd
writes the absolute pathname of the new working directory to the
standard output.
@@ -857,13 +857,25 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
hheellpp [--ddmmss] [_p_a_t_t_e_r_n]
Display helpful information about builtin commands. If _p_a_t_t_e_r_n
is specified, hheellpp gives detailed help on all commands matching
_p_a_t_t_e_r_n; otherwise it displays a list of all the builtins and
shell compound commands.
_p_a_t_t_e_r_n as described below; otherwise it displays a list of all
the builtins and shell compound commands.
Options, if supplied, have the follow meanings:
--dd Display a short description of each _p_a_t_t_e_r_n
--mm Display the description of each _p_a_t_t_e_r_n in a manpage-like
format
--ss Display only a short usage synopsis for each _p_a_t_t_e_r_n
If _p_a_t_t_e_r_n contains pattern matching characters (see PPaatttteerrnn
MMaattcchhiinngg above) it's treated as a shell pattern and hheellpp prints
the description of each help topic matching _p_a_t_t_e_r_n.
If not, and _p_a_t_t_e_r_n exactly matches the name of a help topic,
hheellpp prints the description associated with that topic. Other-
wise, hheellpp performs prefix matching and prints the descriptions
of all matching help topics.
The return status is 0 unless no command matches _p_a_t_t_e_r_n.
hhiissttoorryy [[_n]]
@@ -873,18 +885,18 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e]
hhiissttoorryy --pp _a_r_g [_a_r_g ...]
hhiissttoorryy --ss _a_r_g [_a_r_g ...]
With no options, display the command history list with numbers.
Entries prefixed with a ** have been modified. An argument of _n
lists only the last _n entries. If the shell variable HHIISSTTTTIIMMEE--
FFOORRMMAATT is set and not null, it is used as a format string for
_s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
played history entry. If hhiissttoorryy uses HHIISSTTTTIIMMEEFFOORRMMAATT, it does
not print an intervening space between the formatted time stamp
With no options, display the command history list with numbers.
Entries prefixed with a ** have been modified. An argument of _n
lists only the last _n entries. If the shell variable HHIISSTTTTIIMMEE--
FFOORRMMAATT is set and not null, it is used as a format string for
_s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
played history entry. If hhiissttoorryy uses HHIISSTTTTIIMMEEFFOORRMMAATT, it does
not print an intervening space between the formatted time stamp
and the history entry.
If _f_i_l_e_n_a_m_e is supplied, hhiissttoorryy uses it as the name of the his-
tory file; if not, it uses the value of HHIISSTTFFIILLEE. If _f_i_l_e_n_a_m_e
is not supplied and HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,,
tory file; if not, it uses the value of HHIISSTTFFIILLEE. If _f_i_l_e_n_a_m_e
is not supplied and HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,,
and --ww options have no effect.
Options, if supplied, have the following meanings:
@@ -892,20 +904,20 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
can be used with the other options to replace the history
list.
--dd _o_f_f_s_e_t
Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t
Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t
is negative, it is interpreted as relative to one greater
than the last history position, so negative indices count
back from the end of the history, and an index of -1
back from the end of the history, and an index of -1
refers to the current hhiissttoorryy --dd command.
--dd _s_t_a_r_t-_e_n_d
Delete the range of history entries between positions
_s_t_a_r_t and _e_n_d, inclusive. Positive and negative values
Delete the range of history entries between positions
_s_t_a_r_t and _e_n_d, inclusive. Positive and negative values
for _s_t_a_r_t and _e_n_d are interpreted as described above.
--aa Append the history lines to the history file. These are
history lines entered since the beginning of the current
bbaasshh session, but not already appended to the history
--aa Append the history lines to the history file. These are
history lines entered since the beginning of the current
bbaasshh session, but not already appended to the history
file.
--nn Read the history lines not already read from the history
--nn Read the history lines not already read from the history
file and add them to the current history list. These are
lines appended to the history file since the beginning of
the current bbaasshh session.
@@ -913,24 +925,24 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
rent history list.
--ww Write the current history list to the history file, over-
writing the history file.
--pp Perform history substitution on the following _a_r_g_s and
display the result on the standard output, without stor-
ing the results in the history list. Each _a_r_g must be
--pp Perform history substitution on the following _a_r_g_s and
display the result on the standard output, without stor-
ing the results in the history list. Each _a_r_g must be
quoted to disable normal history expansion.
--ss Store the _a_r_g_s in the history list as a single entry.
The last command in the history list is removed before
--ss Store the _a_r_g_s in the history list as a single entry.
The last command in the history list is removed before
adding the _a_r_g_s.
If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, hhiissttoorryy writes the time
If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, hhiissttoorryy writes the time
stamp information associated with each history entry to the his-
tory file, marked with the history comment character as de-
scribed above. When the history file is read, lines beginning
with the history comment character followed immediately by a
digit are interpreted as timestamps for the following history
tory file, marked with the history comment character as de-
scribed above. When the history file is read, lines beginning
with the history comment character followed immediately by a
digit are interpreted as timestamps for the following history
entry.
The return value is 0 unless an invalid option is encountered,
an error occurs while reading or writing the history file, an
The return value is 0 unless an invalid option is encountered,
an error occurs while reading or writing the history file, an
invalid _o_f_f_s_e_t or range is supplied as an argument to --dd, or the
history expansion supplied as an argument to --pp fails.
@@ -939,14 +951,14 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
The first form lists the active jobs. The options have the fol-
lowing meanings:
--ll List process IDs in addition to the normal information.
--nn Display information only about jobs that have changed
--nn Display information only about jobs that have changed
status since the user was last notified of their status.
--pp List only the process ID of the job's process group
--pp List only the process ID of the job's process group
leader.
--rr Display only running jobs.
--ss Display only stopped jobs.
If _j_o_b_s_p_e_c is supplied, jjoobbss restricts output to information
If _j_o_b_s_p_e_c is supplied, jjoobbss restricts output to information
about that job. The return status is 0 unless an invalid option
is encountered or an invalid _j_o_b_s_p_e_c is supplied.
@@ -956,237 +968,237 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] _i_d [ ... ]
kkiillll --ll|--LL [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s]
Send the signal specified by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
Send the signal specified by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
named by each _i_d. Each _i_d may be a job specification _j_o_b_s_p_e_c or
a process ID _p_i_d. _s_i_g_s_p_e_c is either a case-insensitive signal
name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or a sig-
nal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not sup-
a process ID _p_i_d. _s_i_g_s_p_e_c is either a case-insensitive signal
name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or a sig-
nal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not sup-
plied, then kkiillll sends SSIIGGTTEERRMM.
The --ll option lists the signal names. If any arguments are sup-
plied when --ll is given, kkiillll lists the names of the signals cor-
responding to the arguments, and the return status is 0. The
_e_x_i_t___s_t_a_t_u_s argument to --ll is a number specifying either a sig-
nal number or the exit status of a process terminated by a sig-
nal; if it is supplied, kkiillll prints the name of the signal that
responding to the arguments, and the return status is 0. The
_e_x_i_t___s_t_a_t_u_s argument to --ll is a number specifying either a sig-
nal number or the exit status of a process terminated by a sig-
nal; if it is supplied, kkiillll prints the name of the signal that
caused the process to terminate. kkiillll assumes that process exit
statuses are greater than 128; anything less than that is a sig-
nal number. The --LL option is equivalent to --ll.
kkiillll returns true if at least one signal was successfully sent,
kkiillll returns true if at least one signal was successfully sent,
or false if an error occurs or an invalid option is encountered.
lleett _a_r_g [_a_r_g ...]
Each _a_r_g is evaluated as an arithmetic expression (see AARRIITTHH--
MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)). If the last _a_r_g evaluates to 0,
Each _a_r_g is evaluated as an arithmetic expression (see AARRIITTHH--
MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)). If the last _a_r_g evaluates to 0,
lleett returns 1; otherwise lleett returns 0.
llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ... | - ]
For each argument, create a local variable named _n_a_m_e and assign
it _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddee--
ccllaarree. When llooccaall is used within a function, it causes the
variable _n_a_m_e to have a visible scope restricted to that func-
tion and its children. It is an error to use llooccaall when not
it _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddee--
ccllaarree. When llooccaall is used within a function, it causes the
variable _n_a_m_e to have a visible scope restricted to that func-
tion and its children. It is an error to use llooccaall when not
within a function.
If _n_a_m_e is -, it makes the set of shell options local to the
function in which llooccaall is invoked: any shell options changed
using the sseett builtin inside the function after the call to lloo--
ccaall are restored to their original values when the function re-
turns. The restore is performed as if a series of sseett commands
were executed to restore the values that were in place before
If _n_a_m_e is -, it makes the set of shell options local to the
function in which llooccaall is invoked: any shell options changed
using the sseett builtin inside the function after the call to lloo--
ccaall are restored to their original values when the function re-
turns. The restore is performed as if a series of sseett commands
were executed to restore the values that were in place before
the function.
With no operands, llooccaall writes a list of local variables to the
With no operands, llooccaall writes a list of local variables to the
standard output.
The return status is 0 unless llooccaall is used outside a function,
The return status is 0 unless llooccaall is used outside a function,
an invalid _n_a_m_e is supplied, or _n_a_m_e is a readonly variable.
llooggoouutt [[_n]]
Exit a login shell, returning a status of _n to the shell's par-
Exit a login shell, returning a status of _n to the shell's par-
ent.
mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC
_c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
rreeaaddaarrrraayy [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC
_c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
Read lines from the standard input, or from file descriptor _f_d
if the --uu option is supplied, into the indexed array variable
_a_r_r_a_y. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
Read lines from the standard input, or from file descriptor _f_d
if the --uu option is supplied, into the indexed array variable
_a_r_r_a_y. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
supplied, have the following meanings:
--dd Use the first character of _d_e_l_i_m to terminate each input
--dd Use the first character of _d_e_l_i_m to terminate each input
line, rather than newline. If _d_e_l_i_m is the empty string,
mmaappffiillee will terminate a line when it reads a NUL charac-
ter.
--nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, copy all lines.
--OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
--OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
index is 0.
--ss Discard the first _c_o_u_n_t lines read.
--tt Remove a trailing _d_e_l_i_m (default newline) from each line
--tt Remove a trailing _d_e_l_i_m (default newline) from each line
read.
--uu Read lines from file descriptor _f_d instead of the stan-
--uu Read lines from file descriptor _f_d instead of the stan-
dard input.
--CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
--CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
--cc option specifies _q_u_a_n_t_u_m.
--cc Specify the number of lines read between each call to
--cc Specify the number of lines read between each call to
_c_a_l_l_b_a_c_k.
If --CC is specified without --cc, the default quantum is 5000.
If --CC is specified without --cc, the default quantum is 5000.
When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next
array element to be assigned and the line to be assigned to that
element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after
element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after
the line is read but before the array element is assigned.
If not supplied with an explicit origin, mmaappffiillee will clear _a_r_-
If not supplied with an explicit origin, mmaappffiillee will clear _a_r_-
_r_a_y before assigning to it.
mmaappffiillee returns zero unless an invalid option or option argument
is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is
is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is
not an indexed array.
ppooppdd [-nn] [+_n] [-_n]
Remove entries from the directory stack. The elements are num-
bered from 0 starting at the first directory listed by ddiirrss, so
ppooppdd is equivalent to With no arguments, ppooppdd removes the top
directory from the stack, and changes to the new top directory.
Remove entries from the directory stack. The elements are num-
bered from 0 starting at the first directory listed by ddiirrss, so
ppooppdd is equivalent to With no arguments, ppooppdd removes the top
directory from the stack, and changes to the new top directory.
Arguments, if supplied, have the following meanings:
--nn Suppress the normal change of directory when removing di-
rectories from the stack, only manipulate the stack.
++_n Remove the _nth entry counting from the left of the list
shown by ddiirrss, starting with zero, from the stack. For
++_n Remove the _nth entry counting from the left of the list
shown by ddiirrss, starting with zero, from the stack. For
example: removes the first directory, the second.
--_n Remove the _nth entry counting from the right of the list
shown by ddiirrss, starting with zero. For example: removes
--_n Remove the _nth entry counting from the right of the list
shown by ddiirrss, starting with zero. For example: removes
the last directory, the next to last.
If the top element of the directory stack is modified, and the
_-_n option was not supplied, ppooppdd uses the ccdd builtin to change
If the top element of the directory stack is modified, and the
_-_n option was not supplied, ppooppdd uses the ccdd builtin to change
to the directory at the top of the stack. If the ccdd fails, ppooppdd
returns a non-zero value.
Otherwise, ppooppdd returns false if an invalid option is supplied,
the directory stack is empty, or _n specifies a non-existent di-
Otherwise, ppooppdd returns false if an invalid option is supplied,
the directory stack is empty, or _n specifies a non-existent di-
rectory stack entry.
If the ppooppdd command is successful, bbaasshh runs ddiirrss to show the
final contents of the directory stack, and the return status is
If the ppooppdd command is successful, bbaasshh runs ddiirrss to show the
final contents of the directory stack, and the return status is
0.
pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s]
Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
control of the _f_o_r_m_a_t. The --vv option assigns the output to the
Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
control of the _f_o_r_m_a_t. The --vv option assigns the output to the
variable _v_a_r rather than printing it to the standard output.
The _f_o_r_m_a_t is a character string which contains three types of
objects: plain characters, which are simply copied to standard
output, character escape sequences, which are converted and
copied to the standard output, and format specifications, each
of which causes printing of the next successive _a_r_g_u_m_e_n_t. In
addition to the standard _p_r_i_n_t_f(3) format characters ccCCssSS--
The _f_o_r_m_a_t is a character string which contains three types of
objects: plain characters, which are simply copied to standard
output, character escape sequences, which are converted and
copied to the standard output, and format specifications, each
of which causes printing of the next successive _a_r_g_u_m_e_n_t. In
addition to the standard _p_r_i_n_t_f(3) format characters ccCCssSS--
nnddiioouuxxXXeeEEffFFggGGaaAA, pprriinnttff interprets the following additional for-
mat specifiers:
%%bb causes pprriinnttff to expand backslash escape sequences in the
corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee.
%%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a
format that can be reused as shell input. %%qq and %%QQ use
the $$ quoting style if any characters in the argument
string require it, and backslash quoting otherwise. If
the format string uses the _p_r_i_n_t_f alternate form, these
%%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a
format that can be reused as shell input. %%qq and %%QQ use
the $$ quoting style if any characters in the argument
string require it, and backslash quoting otherwise. If
the format string uses the _p_r_i_n_t_f alternate form, these
two formats quote the argument string using single
quotes.
%%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_-
%%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_-
_m_e_n_t before quoting it.
%%((_d_a_t_e_f_m_t))TT
causes pprriinnttff to output the date-time string resulting
from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3).
causes pprriinnttff to output the date-time string resulting
from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3).
The corresponding _a_r_g_u_m_e_n_t is an integer representing the
number of seconds since the epoch. This format specifier
recognizes two special argument values: -1 represents the
current time, and -2 represents the time the shell was
current time, and -2 represents the time the shell was
invoked. If no argument is specified, conversion behaves
as if -1 had been supplied. This is an exception to the
as if -1 had been supplied. This is an exception to the
usual pprriinnttff behavior.
The %b, %q, and %T format specifiers all use the field width and
precision arguments from the format specification and write that
many bytes from (or use that wide a field for) the expanded ar-
gument, which usually contains more characters than the origi-
many bytes from (or use that wide a field for) the expanded ar-
gument, which usually contains more characters than the origi-
nal.
The %n format specifier accepts a corresponding argument that is
treated as a shell variable name.
The %s and %c format specifiers accept an l (long) modifier,
The %s and %c format specifiers accept an l (long) modifier,
which forces them to convert the argument string to a wide-char-
acter string and apply any supplied field width and precision in
terms of characters, not bytes. The %S and %C format specifiers
are equivalent to %ls and %lc, respectively.
Arguments to non-string format specifiers are treated as C con-
Arguments to non-string format specifiers are treated as C con-
stants, except that a leading plus or minus sign is allowed, and
if the leading character is a single or double quote, the value
is the numeric value of the following character, using the cur-
if the leading character is a single or double quote, the value
is the numeric value of the following character, using the cur-
rent locale.
The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_-
The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_-
_m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied,
the extra format specifications behave as if a zero value or
null string, as appropriate, had been supplied. The return
value is zero on success, non-zero if an invalid option is sup-
the extra format specifications behave as if a zero value or
null string, as appropriate, had been supplied. The return
value is zero on success, non-zero if an invalid option is sup-
plied or a write or assignment error occurs.
ppuusshhdd [--nn] [+_n] [-_n]
ppuusshhdd [--nn] [_d_i_r]
Add a directory to the top of the directory stack, or rotate the
stack, making the new top of the stack the current working di-
rectory. With no arguments, ppuusshhdd exchanges the top two ele-
ments of the directory stack. Arguments, if supplied, have the
stack, making the new top of the stack the current working di-
rectory. With no arguments, ppuusshhdd exchanges the top two ele-
ments of the directory stack. Arguments, if supplied, have the
following meanings:
--nn Suppress the normal change of directory when rotating or
adding directories to the stack, only manipulate the
--nn Suppress the normal change of directory when rotating or
adding directories to the stack, only manipulate the
stack.
++_n Rotate the stack so that the _nth directory (counting from
the left of the list shown by ddiirrss, starting with zero)
the left of the list shown by ddiirrss, starting with zero)
is at the top.
--_n Rotates the stack so that the _nth directory (counting
from the right of the list shown by ddiirrss, starting with
--_n Rotates the stack so that the _nth directory (counting
from the right of the list shown by ddiirrss, starting with
zero) is at the top.
_d_i_r Adds _d_i_r to the directory stack at the top.
After the stack has been modified, if the --nn option was not sup-
plied, ppuusshhdd uses the ccdd builtin to change to the directory at
plied, ppuusshhdd uses the ccdd builtin to change to the directory at
the top of the stack. If the ccdd fails, ppuusshhdd returns a non-zero
value.
Otherwise, if no arguments are supplied, ppuusshhdd returns zero un-
less the directory stack is empty. When rotating the directory
Otherwise, if no arguments are supplied, ppuusshhdd returns zero un-
less the directory stack is empty. When rotating the directory
stack, ppuusshhdd returns zero unless the directory stack is empty or
_n specifies a non-existent directory stack element.
If the ppuusshhdd command is successful, bbaasshh runs ddiirrss to show the
If the ppuusshhdd command is successful, bbaasshh runs ddiirrss to show the
final contents of the directory stack.
ppwwdd [--LLPP]
Print the absolute pathname of the current working directory.
Print the absolute pathname of the current working directory.
The pathname printed contains no symbolic links if the --PP option
is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command
is enabled. If the --LL option is used, the pathname printed may
contain symbolic links. The return status is 0 unless an error
is enabled. If the --LL option is used, the pathname printed may
contain symbolic links. The return status is 0 unless an error
occurs while reading the name of the current directory or an in-
valid option is supplied.
rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s]
[--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...]
Read one line from the standard input, or from the file descrip-
tor _f_d supplied as an argument to the --uu option, split it into
words as described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg, and assign
the first word to the first _n_a_m_e, the second word to the second
_n_a_m_e, and so on. If there are more words than names, the re-
maining words and their intervening delimiters are assigned to
the last _n_a_m_e. If there are fewer words read from the input
stream than names, the remaining names are assigned empty val-
ues. The characters in the value of the IIFFSS variable are used
tor _f_d supplied as an argument to the --uu option, split it into
words as described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg, and assign
the first word to the first _n_a_m_e, the second word to the second
_n_a_m_e, and so on. If there are more words than names, the re-
maining words and their intervening delimiters are assigned to
the last _n_a_m_e. If there are fewer words read from the input
stream than names, the remaining names are assigned empty val-
ues. The characters in the value of the IIFFSS variable are used
to split the line into words using the same rules the shell uses
for expansion (described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg). The
backslash character (\\) removes any special meaning for the next
@@ -1196,190 +1208,190 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--aa _a_n_a_m_e
The words are assigned to sequential indices of the array
variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any
new values are assigned. Other _n_a_m_e arguments are ig-
new values are assigned. Other _n_a_m_e arguments are ig-
nored.
--dd _d_e_l_i_m
The first character of _d_e_l_i_m terminates the input line,
rather than newline. If _d_e_l_i_m is the empty string, rreeaadd
The first character of _d_e_l_i_m terminates the input line,
rather than newline. If _d_e_l_i_m is the empty string, rreeaadd
will terminate a line when it reads a NUL character.
--ee If the standard input is coming from a terminal, rreeaadd
uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the
line. RReeaaddlliinnee uses the current (or default, if line
editing was not previously active) editing settings, but
--ee If the standard input is coming from a terminal, rreeaadd
uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the
line. RReeaaddlliinnee uses the current (or default, if line
editing was not previously active) editing settings, but
uses rreeaaddlliinnee's default filename completion.
--EE If the standard input is coming from a terminal, rreeaadd
uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the
line. RReeaaddlliinnee uses the current (or default, if line
editing was not previously active) editing settings, but
uses bash's default completion, including programmable
--EE If the standard input is coming from a terminal, rreeaadd
uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the
line. RReeaaddlliinnee uses the current (or default, if line
editing was not previously active) editing settings, but
uses bash's default completion, including programmable
completion.
--ii _t_e_x_t
If rreeaaddlliinnee is being used to read the line, rreeaadd places
If rreeaaddlliinnee is being used to read the line, rreeaadd places
_t_e_x_t into the editing buffer before editing begins.
--nn _n_c_h_a_r_s
rreeaadd returns after reading _n_c_h_a_r_s characters rather than
waiting for a complete line of input, unless it encoun-
ters EOF or rreeaadd times out, but honors a delimiter if it
rreeaadd returns after reading _n_c_h_a_r_s characters rather than
waiting for a complete line of input, unless it encoun-
ters EOF or rreeaadd times out, but honors a delimiter if it
reads fewer than _n_c_h_a_r_s characters before the delimiter.
--NN _n_c_h_a_r_s
rreeaadd returns after reading exactly _n_c_h_a_r_s characters
rather than waiting for a complete line of input, unless
rreeaadd returns after reading exactly _n_c_h_a_r_s characters
rather than waiting for a complete line of input, unless
it encounters EOF or rreeaadd times out. Any delimiter char-
acters in the input are not treated specially and do not
acters in the input are not treated specially and do not
cause rreeaadd to return until it has read _n_c_h_a_r_s characters.
The result is not split on the characters in IIFFSS; the in-
tent is that the variable is assigned exactly the charac-
ters read (with the exception of backslash; see the --rr
ters read (with the exception of backslash; see the --rr
option below).
--pp _p_r_o_m_p_t
Display _p_r_o_m_p_t on standard error, without a trailing new-
line, before attempting to read any input, but only if
line, before attempting to read any input, but only if
input is coming from a terminal.
--rr Backslash does not act as an escape character. The back-
slash is considered to be part of the line. In particu-
lar, a backslash-newline pair may not then be used as a
slash is considered to be part of the line. In particu-
lar, a backslash-newline pair may not then be used as a
line continuation.
--ss Silent mode. If input is coming from a terminal, charac-
ters are not echoed.
--tt _t_i_m_e_o_u_t
Cause rreeaadd to time out and return failure if it does not
read a complete line of input (or a specified number of
characters) within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a
decimal number with a fractional portion following the
decimal point. This option is only effective if rreeaadd is
reading input from a terminal, pipe, or other special
file; it has no effect when reading from regular files.
If rreeaadd times out, it saves any partial input read into
the specified variable _n_a_m_e, and the exit status is
greater than 128. If _t_i_m_e_o_u_t is 0, rreeaadd returns immedi-
ately, without trying to read any data. In this case,
the exit status is 0 if input is available on the speci-
fied file descriptor, or the read will return EOF, non-
Cause rreeaadd to time out and return failure if it does not
read a complete line of input (or a specified number of
characters) within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a
decimal number with a fractional portion following the
decimal point. This option is only effective if rreeaadd is
reading input from a terminal, pipe, or other special
file; it has no effect when reading from regular files.
If rreeaadd times out, it saves any partial input read into
the specified variable _n_a_m_e, and the exit status is
greater than 128. If _t_i_m_e_o_u_t is 0, rreeaadd returns immedi-
ately, without trying to read any data. In this case,
the exit status is 0 if input is available on the speci-
fied file descriptor, or the read will return EOF, non-
zero otherwise.
--uu _f_d Read input from file descriptor _f_d instead of the stan-
--uu _f_d Read input from file descriptor _f_d instead of the stan-
dard input.
Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig-
Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig-
nores any NUL characters in the input.
If no _n_a_m_e_s are supplied, rreeaadd assigns the line read, without
the ending delimiter but otherwise unmodified, to the variable
If no _n_a_m_e_s are supplied, rreeaadd assigns the line read, without
the ending delimiter but otherwise unmodified, to the variable
RREEPPLLYY.
The exit status is zero, unless end-of-file is encountered, rreeaadd
times out (in which case the status is greater than 128), a
times out (in which case the status is greater than 128), a
variable assignment error (such as assigning to a readonly vari-
able) occurs, or an invalid file descriptor is supplied as the
able) occurs, or an invalid file descriptor is supplied as the
argument to --uu.
rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...]
The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
may not be changed by subsequent assignment or unset. If the --ff
option is supplied, each _n_a_m_e refers to a shell function. The
--aa option restricts the variables to indexed arrays; the --AA op-
option is supplied, each _n_a_m_e refers to a shell function. The
--aa option restricts the variables to indexed arrays; the --AA op-
tion restricts the variables to associative arrays. If both op-
tions are supplied, --AA takes precedence. If no _n_a_m_e arguments
are supplied, or if the --pp option is supplied, print a list of
all readonly names. The other options may be used to restrict
tions are supplied, --AA takes precedence. If no _n_a_m_e arguments
are supplied, or if the --pp option is supplied, print a list of
all readonly names. The other options may be used to restrict
the output to a subset of the set of readonly names. The --pp op-
tion displays output in a format that may be reused as input.
rreeaaddoonnllyy allows the value of a variable to be set at the same
rreeaaddoonnllyy allows the value of a variable to be set at the same
time the readonly attribute is changed by following the variable
name with =_v_a_l_u_e. This sets the value of the variable is to
name with =_v_a_l_u_e. This sets the value of the variable is to
_v_a_l_u_e while modifying the readonly attribute.
The return status is 0 unless an invalid option is encountered,
one of the _n_a_m_e_s is not a valid shell variable name, or --ff is
The return status is 0 unless an invalid option is encountered,
one of the _n_a_m_e_s is not a valid shell variable name, or --ff is
supplied with a _n_a_m_e that is not a function.
rreettuurrnn [_n]
Stop executing a shell function or sourced file and return the
Stop executing a shell function or sourced file and return the
value specified by _n to its caller. If _n is omitted, the return
status is that of the last command executed. If rreettuurrnn is exe-
cuted by a trap handler, the last command used to determine the
status is that of the last command executed. If rreettuurrnn is exe-
cuted by a trap handler, the last command used to determine the
status is the last command executed before the trap handler. If
rreettuurrnn is executed during a DDEEBBUUGG trap, the last command used to
determine the status is the last command executed by the trap
determine the status is the last command executed by the trap
handler before rreettuurrnn was invoked.
When rreettuurrnn is used to terminate execution of a script being ex-
ecuted by the .. (ssoouurrccee) command, it causes the shell to stop
executing that script and return either _n or the exit status of
the last command executed within the script as the exit status
of the script. If _n is supplied, the return value is its least
ecuted by the .. (ssoouurrccee) command, it causes the shell to stop
executing that script and return either _n or the exit status of
the last command executed within the script as the exit status
of the script. If _n is supplied, the return value is its least
significant 8 bits.
Any command associated with the RREETTUURRNN trap is executed before
Any command associated with the RREETTUURRNN trap is executed before
execution resumes after the function or script.
The return status is non-zero if rreettuurrnn is supplied a non-nu-
The return status is non-zero if rreettuurrnn is supplied a non-nu-
meric argument, or is used outside a function and not during ex-
ecution of a script by .. or ssoouurrccee.
sseett [--aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...]
sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...]
sseett --oo
sseett ++oo Without options, display the name and value of each shell vari-
able in a format that can be reused as input for setting or re-
sseett ++oo Without options, display the name and value of each shell vari-
able in a format that can be reused as input for setting or re-
setting the currently-set variables. Read-only variables cannot
be reset. In posix mode, only shell variables are listed. The
output is sorted according to the current locale. When options
are specified, they set or unset shell attributes. Any argu-
ments remaining after option processing are treated as values
be reset. In posix mode, only shell variables are listed. The
output is sorted according to the current locale. When options
are specified, they set or unset shell attributes. Any argu-
ments remaining after option processing are treated as values
for the positional parameters and are assigned, in order, to $$11,
$$22, ..., $$_n. Options, if specified, have the following mean-
$$22, ..., $$_n. Options, if specified, have the following mean-
ings:
--aa Each variable or function that is created or modified is
given the export attribute and marked for export to the
given the export attribute and marked for export to the
environment of subsequent commands.
--bb Report the status of terminated background jobs immedi-
--bb Report the status of terminated background jobs immedi-
ately, rather than before the next primary prompt or af-
ter a foreground command terminates. This is effective
ter a foreground command terminates. This is effective
only when job control is enabled.
--ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a
single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d
(see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)), exits with a non-zero
status. The shell does not exit if the command that
fails is part of the command list immediately following
--ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a
single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d
(see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)), exits with a non-zero
status. The shell does not exit if the command that
fails is part of the command list immediately following
a wwhhiillee or uunnttiill keyword, part of the test following the
iiff or eelliiff reserved words, part of any command executed
in a &&&& or |||| list except the command following the fi-
nal &&&& or ||||, any command in a pipeline but the last
(subject to the state of the ppiippeeffaaiill shell option), or
if the command's return value is being inverted with !!.
If a compound command other than a subshell returns a
non-zero status because a command failed while --ee was
being ignored, the shell does not exit. A trap on EERRRR,
iiff or eelliiff reserved words, part of any command executed
in a &&&& or |||| list except the command following the fi-
nal &&&& or ||||, any command in a pipeline but the last
(subject to the state of the ppiippeeffaaiill shell option), or
if the command's return value is being inverted with !!.
If a compound command other than a subshell returns a
non-zero status because a command failed while --ee was
being ignored, the shell does not exit. A trap on EERRRR,
if set, is executed before the shell exits. This option
applies to the shell environment and each subshell envi-
ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT in
_b_a_s_h(1)), and may cause subshells to exit before execut-
ing all the commands in the subshell.
If a compound command or shell function executes in a
context where --ee is being ignored, none of the commands
executed within the compound command or function body
will be affected by the --ee setting, even if --ee is set
and a command returns a failure status. If a compound
command or shell function sets --ee while executing in a
context where --ee is ignored, that setting will not have
any effect until the compound command or the command
If a compound command or shell function executes in a
context where --ee is being ignored, none of the commands
executed within the compound command or function body
will be affected by the --ee setting, even if --ee is set
and a command returns a failure status. If a compound
command or shell function sets --ee while executing in a
context where --ee is ignored, that setting will not have
any effect until the compound command or the command
containing the function call completes.
--ff Disable pathname expansion.
--hh Remember the location of commands as they are looked up
--hh Remember the location of commands as they are looked up
for execution. This is enabled by default.
--kk All arguments in the form of assignment statements are
placed in the environment for a command, not just those
--kk All arguments in the form of assignment statements are
placed in the environment for a command, not just those
that precede the command name.
--mm Monitor mode. Job control is enabled. This option is
on by default for interactive shells on systems that
support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). All processes
run in a separate process group. When a background job
completes, the shell prints a line containing its exit
--mm Monitor mode. Job control is enabled. This option is
on by default for interactive shells on systems that
support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). All processes
run in a separate process group. When a background job
completes, the shell prints a line containing its exit
status.
--nn Read commands but do not execute them. This may be used
to check a shell script for syntax errors. This is ig-
to check a shell script for syntax errors. This is ig-
nored by interactive shells.
--oo _o_p_t_i_o_n_-_n_a_m_e
The _o_p_t_i_o_n_-_n_a_m_e can be one of the following:
@@ -1387,10 +1399,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Same as --aa.
bbrraacceeeexxppaanndd
Same as --BB.
eemmaaccss Use an emacs-style command line editing inter-
eemmaaccss Use an emacs-style command line editing inter-
face. This is enabled by default when the shell
is interactive, unless the shell is started with
the ----nnooeeddiittiinngg option. This also affects the
the ----nnooeeddiittiinngg option. This also affects the
editing interface used for rreeaadd --ee.
eerrrreexxiitt Same as --ee.
eerrrrttrraaccee
@@ -1400,11 +1412,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
hhaasshhaallll Same as --hh.
hhiisstteexxppaanndd
Same as --HH.
hhiissttoorryy Enable command history, as described in _b_a_s_h(1)
under HHIISSTTOORRYY. This option is on by default in
hhiissttoorryy Enable command history, as described in _b_a_s_h(1)
under HHIISSTTOORRYY. This option is on by default in
interactive shells.
iiggnnoorreeeeooff
The effect is as if the shell command had been
The effect is as if the shell command had been
executed (see SShheellll VVaarriiaabblleess in _b_a_s_h(1)).
kkeeyywwoorrdd Same as --kk.
mmoonniittoorr Same as --mm.
@@ -1419,16 +1431,17 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
pphhyyssiiccaall
Same as --PP.
ppiippeeffaaiill
If set, the return value of a pipeline is the
value of the last (rightmost) command to exit
with a non-zero status, or zero if all commands
in the pipeline exit successfully. This option
If set, the return value of a pipeline is the
value of the last (rightmost) command to exit
with a non-zero status, or zero if all commands
in the pipeline exit successfully. This option
is disabled by default.
ppoossiixx Change the behavior of bbaasshh where the default
operation differs from the POSIX standard to
match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO
in _b_a_s_h(1) for a reference to a document that
details how posix mode affects bash's behavior.
ppoossiixx Enable posix mode; change the behavior of bbaasshh
where the default operation differs from the
POSIX standard to match the standard. See SSEEEE
AALLSSOO in _b_a_s_h(1) for a reference to a document
that details how posix mode affects bash's be-
havior.
pprriivviilleeggeedd
Same as --pp.
vveerrbboossee Same as --vv.
@@ -2205,7 +2218,7 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
locale's collation sequence and _s_t_r_c_o_l_l(3).
ccoommppaatt4411
+o In _p_o_s_i_x mode, ttiimmee may be followed by options and still
+o In posix mode, ttiimmee may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267).
+o In _p_o_s_i_x mode, the parser requires that an even number of
BIN
View File
Binary file not shown.
+4 -4
View File
@@ -1,11 +1,11 @@
@ignore
Copyright (C) 1988-2024 Free Software Foundation, Inc.
Copyright (C) 1988-2025 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Thu Dec 12 13:37:30 EST 2024
@set LASTCHANGE Wed Jan 8 09:27:44 EST 2025
@set EDITION 5.3
@set VERSION 5.3
@set UPDATED 12 December 2024
@set UPDATED-MONTH December 2024
@set UPDATED 8 January 2025
@set UPDATED-MONTH January 2025
+4 -3
View File
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Fri Nov 29 18:17:58 EST 2024
.\" Last Change: Tue Dec 31 13:35:52 EST 2024
.\"
.TH HISTORY 3 "2024 November 29" "GNU History 8.3"
.TH HISTORY 3 "2024 December 31" "GNU History 8.3"
.\"
.ie \n(.g \{\
.ds ' \(aq
@@ -495,7 +495,8 @@ The history list will contain only \fImax\fP entries at a time.
.F1 int unstifle_history "void"
Stop stifling the history. This returns the previously-set
maximum number of history entries (as set by \fBstifle_history()\fP).
history was stifled. The value is positive if the history was
history was stifled.
The value is positive if the history was
stifled, negative if it wasn't.
.PP
.F1 int history_is_stifled "void"
+1 -1
View File
@@ -36,7 +36,7 @@ For information on the interactive use of @sc{gnu} History,
* Introduction to History:: What is the GNU History library for?
* History Storage:: How information is stored.
* History Functions:: Functions that you can use.
* History Variables:: Variables that control behaviour.
* History Variables:: Variables that control behavior.
* History Programming Example:: Example of using the GNU History Library.
@end menu
+4 -4
View File
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Fri Nov 29 18:17:27 EST 2024
.\" Last Change: Mon Dec 30 11:27:47 EST 2024
.\"
.TH READLINE 3 "2024 November 29" "GNU Readline 8.3"
.TH READLINE 3 "2024 December 30" "GNU Readline 8.3"
.\"
.ie \n(.g \{\
.ds ' \(aq
@@ -1248,7 +1248,7 @@ Negative arguments have no effect.
.TP
.B transpose\-words (M\-t)
Drag the word before point past the word after point,
moving point over that word as well.
moving point past that word as well.
If point is at the end of the line, this transposes
the last two words on the line.
.TP
@@ -1438,7 +1438,7 @@ the number of matches \fIN\fP;
the word being completed;
.IP \(bu
\fIS\fP:\fIE\fP,
where S and E are the start and end offsets of the word
where \fIS\fP and \fIE\fP are the start and end offsets of the word
in the \fBreadline\fP line buffer; then
.IP \(bu
each match, one per line
+4 -4
View File
@@ -58,7 +58,7 @@ in your own programs, this section is for you.
Many programs provide a command line interface, such as @code{mail},
@code{ftp}, and @code{sh}.
For such programs, the default behaviour of Readline is sufficient.
For such programs, the default behavior of Readline is sufficient.
This section describes how to use Readline in
the simplest way possible, perhaps to replace calls in your code to
@code{fgets()}.
@@ -149,7 +149,7 @@ rl_gets ()
@}
@end example
This function gives the user the default behaviour of @key{TAB}
This function gives the user the default behavior of @key{TAB}
completion: filename completion.
If you do not want Readline to
complete filenames, you can change the binding of the @key{TAB} key
@@ -768,7 +768,7 @@ The caller should free @var{keymap}.
@deftypefun void rl_free_keymap (Keymap keymap)
Free all storage associated with @var{keymap}.
This calls @code{rl_discard_keymap} to free subordindate
This calls @code{rl_discard_keymap} to free subordinate
keymaps and macros.
@end deftypefun
@@ -1168,7 +1168,7 @@ displaying a new message in the message area with @code{rl_message()}.
@deftypefun void rl_restore_prompt (void)
Restore the local Readline prompt display state saved by the most
recent call to @code{rl_save_prompt}.
if you called @code{rl_save_prompt} to save the prompt before a call
If you called @code{rl_save_prompt} to save the prompt before a call
to @code{rl_message}, you should call this function before the
corresponding call to @code{rl_clear_message}.
@end deftypefun
+14 -10
View File
@@ -466,9 +466,10 @@ A sample value might be @samp{\e[01;33m}.
@item active-region-end-color
@vindex active-region-end-color
A string variable that "undoes" the effects of @code{active-region-start-color}
and restores "normal" terminal display appearance after displaying text
in the active region.
A string variable that ``undoes''
the effects of @code{active-region-start-color}
and restores ``normal''
terminal display appearance after displaying text in the active region.
This string must not take up any physical character positions on the display,
so it should consist only of terminal escape sequences.
It is output to the terminal after displaying the text in the active region.
@@ -703,7 +704,7 @@ are saved.
If set to a value less than zero, the number of history entries is not
limited.
@ifset BashFeatures
By default, Bash sets the the maximum number of history entries to
By default, Bash sets the maximum number of history entries to
the value of the @code{HISTSIZE} shell variable.
@end ifset
@ifclear BashFeatures
@@ -1055,7 +1056,7 @@ The eight-bit character whose value is the hexadecimal value @var{HH}
When entering the text of a macro, single or double quotes must
be used to indicate a macro definition.
Unquoted text is assumed to be a function name.
Tthe backslash escapes described above are expanded
The backslash escapes described above are expanded
in the macro body.
Backslash will quote any other character in the macro text,
including @samp{"} and @samp{'}.
@@ -1188,7 +1189,7 @@ binding, variable assignment, and conditional syntax.
@example
@page
# This file controls the behaviour of line input editing for
# This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
@@ -1316,10 +1317,13 @@ In the following descriptions, @dfn{point} refers to the current cursor
position, and @dfn{mark} refers to a cursor position saved by the
@code{set-mark} command.
The text between the point and mark is referred to as the @dfn{region}.
Readline has the concept of an @emph{active region}:
Readline
has the concept of an @emph{active region}:
when the region is active,
Readline redisplay highlights the region using the
value of the @code{active-region-start-color} variable.
value of the
@code{active-region-start-color}
variable.
The @code{enable-active-region} variable turns this on and off.
Several commands set the region to active; those are noted below.
@@ -1806,7 +1810,7 @@ the number of matches @var{N};
the word being completed;
@item
@var{S}:@var{E},
where S and E are the start and end offsets of the word
where @var{S} and @var{E} are the start and end offsets of the word
in the Readline line buffer; then
@item
each match, one per line
@@ -2057,7 +2061,7 @@ Expand the line by performing shell word expansions.
This performs alias and history expansion,
$'@var{string}' and $"@var{string}" quoting,
tilde expansion, parameter and variable expansion, arithmetic expansion,
command and proces substitution,
command and process substitution,
word splitting, and quote removal.
An explicit argument suppresses command and process substitution.
+3 -3
View File
@@ -5,7 +5,7 @@ Copyright (C) 1988-2024 Free Software Foundation, Inc.
@set EDITION 8.3
@set VERSION 8.3
@set UPDATED 29 November 2024
@set UPDATED-MONTH November 2024
@set UPDATED 30 December 2024
@set UPDATED-MONTH December 2024
@set LASTCHANGE Fri Nov 29 18:18:20 EST 2024
@set LASTCHANGE Mon Dec 30 11:27:03 EST 2024
-3
View File
@@ -990,10 +990,7 @@ exit_shell (int s)
/* Clean up the terminal if we are in a state where it's been modified. */
#if defined (READLINE)
if (bash_readline_initialized && RL_ISSTATE (RL_STATE_TERMPREPPED) && rl_deprep_term_function)
{
itrace("exit_shell: calling rl_deprep_term_function");
(*rl_deprep_term_function) ();
}
#endif
if (read_tty_modified ())
read_tty_cleanup ();
+12 -14
View File
@@ -1,10 +1,10 @@
printf: usage: printf [-v var] format [arguments]
printf: usage: printf [-v var] format [arguments]
./printf.tests: line 26: printf: -x: invalid option
./printf.tests: line 44: printf: -x: invalid option
printf: usage: printf [-v var] format [arguments]
./printf.tests: line 29: printf: `invalid-var': not a valid identifier
./printf.tests: line 47: printf: `invalid-var': not a valid identifier
abc
./printf.tests: line 30: printf: `invalid-var': not a valid identifier
./printf.tests: line 48: printf: `invalid-var': not a valid identifier
10
one
one\ctwo
@@ -40,7 +40,7 @@ A7
--\"abcd\"--
--\'abcd\'--
--a\x--
./printf.tests: line 115: printf: missing hex digit for \x
./printf.tests: line 133: printf: missing hex digit for \x
--\x--
----
----
@@ -101,12 +101,12 @@ A7
26
26
26
./printf.tests: line 239: printf: `%10': missing format character
./printf.tests: line 240: printf: `M': invalid format character
ab./printf.tests: line 243: printf: `y': invalid format character
./printf.tests: line 246: printf: GNU: invalid number
./printf.tests: line 257: printf: `%10': missing format character
./printf.tests: line 258: printf: `M': invalid format character
ab./printf.tests: line 261: printf: `y': invalid format character
./printf.tests: line 264: printf: GNU: invalid number
0
./printf.tests: line 247: printf: GNU: invalid number
./printf.tests: line 265: printf: GNU: invalid number
0
-
(foo )(bar )
@@ -165,15 +165,13 @@ xx
0.00
''
''
./printf.tests: line 364: printf: 9223372036854775825: Result too large
9223372036854775807
./printf.tests: line 365: printf: -9223372036854775815: Result too large
-9223372036854775808
./printf.tests: line 368: printf: +: invalid number
./printf.tests: line 386: printf: +: invalid number
0
./printf.tests: line 369: printf: z: invalid number
./printf.tests: line 387: printf: z: invalid number
0
./printf.tests: line 370: printf: : invalid number
./printf.tests: line 388: printf: : invalid number
0
one
one\ctwo
+20 -2
View File
@@ -14,6 +14,24 @@
LC_ALL=C
LC_NUMERIC=C
: ${TMPDIR:=/tmp}
TMPF=$TMPDIR/printf-oflow-$RANDOM
printf_overflow ()
{
local r;
line=$1 ; shift
rm -f "$TMPF"
printf "$@" 2>$TMPF
r=$?
if [ ! -s "$TMPF" ]; then
echo "printf.tests: $line: expected overflow error output to stderr" >&2
fi
rm -f "$TMPF"
return $r
}
# these should output error messages -- the format is required
printf
printf --
@@ -361,8 +379,8 @@ printf '%Q\n'
TOOBIG=9223372036854775825
TOOSMALL=-9223372036854775815
printf '%d\n' "$TOOBIG"
printf '%d\n' "$TOOSMALL"
printf_overflow $LINENO '%d\n' "$TOOBIG"
printf_overflow $LINENO '%d\n' "$TOOSMALL"
# arguments that are not completely converted generate warning messages
printf '%d\n' +
+6
View File
@@ -39,6 +39,12 @@ if [ "${BASH_VERSION+set}" = "set" ]; then
else
[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS 2>/dev/null
fi
# ditto for BASHOPTS, which is also readonly in bash
if [ "${BASH_VERSION+set}" = "set" ]; then
export -n BASHOPTS # just make sure its not exported
else
[ "${BASHOPTS+set}" = "set" ] && unset BASHOPTS 2>/dev/null
fi
: ${THIS_SH:=../bash}
export THIS_SH
+14 -2
View File
@@ -34,8 +34,20 @@ export PATH
# unset BASH_ENV only if it is set
[ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV
# ditto for SHELLOPTS
#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS
# can't reliably do it for SHELLOPTS; SHELLOPTS is readonly in bash
if [ "${BASH_VERSION+set}" = "set" ]; then
export -n SHELLOPTS # just make sure its not exported
set +o posix
typeset -p SHELLOPTS
else
[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS 2>/dev/null
fi
# ditto for BASHOPTS, which is also readonly in bash
if [ "${BASH_VERSION+set}" = "set" ]; then
export -n BASHOPTS # just make sure its not exported
else
[ "${BASHOPTS+set}" = "set" ] && unset BASHOPTS 2>/dev/null
fi
: ${THIS_SH:=../bash}
export THIS_SH