mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-08 03:02:40 +02:00
commit bash-20110525 snapshot
This commit is contained in:
+11
-5
@@ -1866,7 +1866,8 @@ A sample value is
|
||||
.TP
|
||||
.B COLUMNS
|
||||
Used by the \fBselect\fP compound command to determine the terminal width
|
||||
when printing selection lists. Automatically set upon receipt of a
|
||||
when printing selection lists. Automatically set in an interactive shell
|
||||
upon receipt of a
|
||||
.SM
|
||||
.BR SIGWINCH .
|
||||
.TP
|
||||
@@ -2098,7 +2099,8 @@ This variable determines the locale category used for number formatting.
|
||||
.TP
|
||||
.B LINES
|
||||
Used by the \fBselect\fP compound command to determine the column length
|
||||
for printing selection lists. Automatically set upon receipt of a
|
||||
for printing selection lists. Automatically set by an interactive shell
|
||||
upon receipt of a
|
||||
.SM
|
||||
.BR SIGWINCH .
|
||||
.TP
|
||||
@@ -8913,7 +8915,8 @@ above). The shell always
|
||||
postpones exiting if any jobs are stopped.
|
||||
.TP 8
|
||||
.B checkwinsize
|
||||
If set, \fBbash\fP checks the window size after each command
|
||||
If set, \fBbash\fP checks the window size after each command when running
|
||||
interactively
|
||||
and, if necessary, updates the values of
|
||||
.SM
|
||||
.B LINES
|
||||
@@ -9669,11 +9672,11 @@ is not a defined alias.
|
||||
For each
|
||||
.IR name ,
|
||||
remove the corresponding variable or function.
|
||||
If no options are supplied, or the
|
||||
If the
|
||||
.B \-v
|
||||
option is given, each
|
||||
.I name
|
||||
refers to a shell variable.
|
||||
refers to a shell variable, and that variable is removed.
|
||||
Read-only variables may not be unset.
|
||||
If
|
||||
.B \-f
|
||||
@@ -9681,6 +9684,9 @@ is specified, each
|
||||
.I name
|
||||
refers to a shell function, and the function definition
|
||||
is removed.
|
||||
If no options are supplied, each \fIname\fP refers to a variable; if
|
||||
there is no variable by that name, any function with that name is
|
||||
unset.
|
||||
Each unset variable or function is removed from the environment
|
||||
passed to subsequent commands.
|
||||
If any of
|
||||
|
||||
+29
-14
@@ -5,12 +5,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Tue Dec 28 13:41:43 EST 2010
|
||||
.\" Last Change: Mon May 9 12:23:35 EDT 2011
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2010 December 28" "GNU Bash-4.2"
|
||||
.TH BASH 1 "2011 May 9" "GNU Bash 4.2"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -646,7 +646,10 @@ AND and OR lists is the exit status of the last command
|
||||
executed in the list.
|
||||
.SS Compound Commands
|
||||
.PP
|
||||
A \fIcompound command\fP is one of the following:
|
||||
A \fIcompound command\fP is one of the following.
|
||||
In most cases a \fIlist\fP in a command's description may be separated from
|
||||
the rest of the command by one or more newlines, and may be followed by a
|
||||
newline in place of a semicolon.
|
||||
.TP
|
||||
(\fIlist\fP)
|
||||
\fIlist\fP is executed in a subshell environment (see
|
||||
@@ -911,7 +914,7 @@ The format for a coprocess is:
|
||||
.RE
|
||||
.PP
|
||||
This creates a coprocess named \fINAME\fP.
|
||||
If \fINAME\fP is not supplied, the default name is \fICOPROC\fP.
|
||||
If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP.
|
||||
\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple
|
||||
command\fP (see above); otherwise, it is interpreted as the first word
|
||||
of the simple command.
|
||||
@@ -1465,7 +1468,8 @@ The shell function
|
||||
\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP.
|
||||
.TP
|
||||
.B BASH_SUBSHELL
|
||||
Incremented by one each time a subshell or subshell environment is spawned.
|
||||
Incremented by one within each subshell or subshell environment when
|
||||
the shell begins executing in that environment.
|
||||
The initial value is 0.
|
||||
.TP
|
||||
.B BASH_VERSINFO
|
||||
@@ -2163,8 +2167,8 @@ The default path is system-dependent,
|
||||
and is set by the administrator who installs
|
||||
.BR bash .
|
||||
A common value is
|
||||
.if t \f(CW/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin\fP.
|
||||
.if n ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin''.
|
||||
.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP.
|
||||
.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''.
|
||||
.TP
|
||||
.B POSIXLY_CORRECT
|
||||
If this variable is in the environment when \fBbash\fP starts, the shell
|
||||
@@ -3123,7 +3127,11 @@ If one of these characters appears, then the word is
|
||||
regarded as a
|
||||
.IR pattern ,
|
||||
and replaced with an alphabetically sorted list of
|
||||
file names matching the pattern.
|
||||
file names matching the pattern
|
||||
(see
|
||||
.SM
|
||||
.B "Pattern Matching"
|
||||
below).
|
||||
If no matching file names are found,
|
||||
and the shell option
|
||||
.B nullglob
|
||||
@@ -3528,6 +3536,7 @@ This is semantically equivalent to
|
||||
\fB>\fP\fIword\fP 2\fB>&\fP1
|
||||
.RE
|
||||
.PP
|
||||
(see \fBDuplicating File Descriptors\fP below).
|
||||
.SS Appending Standard Output and Standard Error
|
||||
.PP
|
||||
This construct allows both the
|
||||
@@ -3548,6 +3557,8 @@ This is semantically equivalent to
|
||||
.PP
|
||||
\fB>>\fP\fIword\fP 2\fB>&\fP1
|
||||
.RE
|
||||
.PP
|
||||
(see \fBDuplicating File Descriptors\fP below).
|
||||
.SS Here Documents
|
||||
.PP
|
||||
This type of redirection instructs the shell to read input from the
|
||||
@@ -7330,7 +7341,7 @@ does not specify a valid job.
|
||||
.TP
|
||||
\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...]
|
||||
Output the \fIarg\fPs, separated by spaces, followed by a newline.
|
||||
The return status is always 0.
|
||||
The return status is 0 unless a write error occurs.
|
||||
If \fB\-n\fP is specified, the trailing newline is
|
||||
suppressed. If the \fB\-e\fP option is given, interpretation of
|
||||
the following backslash-escaped characters is enabled. The
|
||||
@@ -8519,9 +8530,10 @@ by default for interactive shells on systems that support
|
||||
it (see
|
||||
.SM
|
||||
.B JOB CONTROL
|
||||
above). Background processes run in a separate process
|
||||
group and a line containing their exit status is printed
|
||||
upon their completion.
|
||||
above).
|
||||
All processes run in a separate process group.
|
||||
When a background job completes, the shell prints a line
|
||||
containing its exit status.
|
||||
.TP 8
|
||||
.B \-n
|
||||
Read commands but do not execute them. This may be used to
|
||||
@@ -9657,11 +9669,11 @@ is not a defined alias.
|
||||
For each
|
||||
.IR name ,
|
||||
remove the corresponding variable or function.
|
||||
If no options are supplied, or the
|
||||
If the
|
||||
.B \-v
|
||||
option is given, each
|
||||
.I name
|
||||
refers to a shell variable.
|
||||
refers to a shell variable, and that variable is removed.
|
||||
Read-only variables may not be unset.
|
||||
If
|
||||
.B \-f
|
||||
@@ -9669,6 +9681,9 @@ is specified, each
|
||||
.I name
|
||||
refers to a shell function, and the function definition
|
||||
is removed.
|
||||
If no options are supplied, each \fIname\fP refers to a variable; if
|
||||
there is no variable by that name, any function with that name is
|
||||
unset.
|
||||
Each unset variable or function is removed from the environment
|
||||
passed to subsequent commands.
|
||||
If any of
|
||||
|
||||
+16
-7
@@ -185,7 +185,7 @@ Shells also provide a small set of built-in
|
||||
commands (@dfn{builtins}) implementing functionality impossible
|
||||
or inconvenient to obtain via separate utilities.
|
||||
For example, @code{cd}, @code{break}, @code{continue}, and
|
||||
@code{exec}) cannot be implemented outside of the shell because
|
||||
@code{exec} cannot be implemented outside of the shell because
|
||||
they directly manipulate the shell itself.
|
||||
The @code{history}, @code{getopts}, @code{kill}, or @code{pwd}
|
||||
builtins, among others, could be implemented in separate utilities,
|
||||
@@ -3368,10 +3368,13 @@ results in permissions of @code{755}.
|
||||
unset [-fv] [@var{name}]
|
||||
@end example
|
||||
Each variable or function @var{name} is removed.
|
||||
If no options are supplied, or the @option{-v} option is given, each
|
||||
@var{name} refers to a shell variable.
|
||||
If the @option{-v} option is given, each
|
||||
@var{name} refers to a shell variable and that variable is remvoved.
|
||||
If the @option{-f} option is given, the @var{name}s refer to shell
|
||||
functions, and the function definition is removed.
|
||||
If no options are supplied, each @var{name} refers to a variable; if
|
||||
there is no variable by that name, any function with that name is
|
||||
unset.
|
||||
Readonly variables and functions may not be unset.
|
||||
The return status is zero unless a @var{name} is readonly.
|
||||
@end table
|
||||
@@ -4510,8 +4513,8 @@ intervening command (@pxref{Job Control}).
|
||||
The shell always postpones exiting if any jobs are stopped.
|
||||
|
||||
@item checkwinsize
|
||||
If set, Bash checks the window size after each command
|
||||
and, if necessary, updates the values of
|
||||
If set, Bash checks the window size after each command when running
|
||||
interactively and, if necessary, updates the values of
|
||||
@env{LINES} and @env{COLUMNS}.
|
||||
|
||||
@item cmdhist
|
||||
@@ -5005,7 +5008,8 @@ being closed.
|
||||
|
||||
@item COLUMNS
|
||||
Used by the @code{select} command to determine the terminal width
|
||||
when printing selection lists. Automatically set upon receipt of a
|
||||
when printing selection lists. Automatically set by an interactive shell
|
||||
upon receipt of a
|
||||
@code{SIGWINCH}.
|
||||
|
||||
@item COMP_CWORD
|
||||
@@ -5294,7 +5298,8 @@ The line number in the script or shell function currently executing.
|
||||
|
||||
@item LINES
|
||||
Used by the @code{select} command to determine the column length
|
||||
for printing selection lists. Automatically set upon receipt of a
|
||||
for printing selection lists. Automatically set by an interactive shell
|
||||
upon receipt of a
|
||||
@code{SIGWINCH}.
|
||||
|
||||
@item MACHTYPE
|
||||
@@ -6742,6 +6747,10 @@ variable in a @code{for} statement or the selection variable in a
|
||||
@item
|
||||
Process substitution is not available.
|
||||
|
||||
@item
|
||||
While variable indirection is available, it may not be applied to the
|
||||
@samp{#} and @samp{?} special parameters.
|
||||
|
||||
@item
|
||||
Assignment statements preceding @sc{posix} special builtins
|
||||
persist in the shell environment after the builtin completes.
|
||||
|
||||
+30
-10
@@ -185,7 +185,7 @@ Shells also provide a small set of built-in
|
||||
commands (@dfn{builtins}) implementing functionality impossible
|
||||
or inconvenient to obtain via separate utilities.
|
||||
For example, @code{cd}, @code{break}, @code{continue}, and
|
||||
@code{exec}) cannot be implemented outside of the shell because
|
||||
@code{exec} cannot be implemented outside of the shell because
|
||||
they directly manipulate the shell itself.
|
||||
The @code{history}, @code{getopts}, @code{kill}, or @code{pwd}
|
||||
builtins, among others, could be implemented in separate utilities,
|
||||
@@ -753,6 +753,10 @@ terminated by a corresponding reserved word or operator.
|
||||
Any redirections (@pxref{Redirections}) associated with a compound command
|
||||
apply to all commands within that compound command unless explicitly overridden.
|
||||
|
||||
In most cases a list of commands in a compound command's description may be
|
||||
separated from the rest of the command by one or more newlines, and may be
|
||||
followed by a newline in place of a semicolon.
|
||||
|
||||
Bash provides looping constructs, conditional commands, and mechanisms
|
||||
to group commands and execute them as a unit.
|
||||
|
||||
@@ -1554,7 +1558,7 @@ This mechanism is similar to
|
||||
@var{filename expansion} (@pxref{Filename Expansion}),
|
||||
but the file names generated need not exist.
|
||||
Patterns to be brace expanded take the form of an optional @var{preamble},
|
||||
followed by either a series of comma-separated strings or a seqeunce expression
|
||||
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
|
||||
@@ -2044,7 +2048,8 @@ After word splitting, unless the @option{-f} option has been set
|
||||
If one of these characters appears, then the word is
|
||||
regarded as a @var{pattern},
|
||||
and replaced with an alphabetically sorted list of
|
||||
file names matching the pattern. If no matching file names are found,
|
||||
file names matching the pattern (@pxref{Pattern Matching}).
|
||||
If no matching file names are found,
|
||||
and the shell option @code{nullglob} is disabled, the word is left
|
||||
unchanged.
|
||||
If the @code{nullglob} option is set, and no matches are found, the word
|
||||
@@ -2337,6 +2342,7 @@ This is semantically equivalent to
|
||||
@example
|
||||
>@var{word} 2>&1
|
||||
@end example
|
||||
(see Duplicating File Descriptors below).
|
||||
|
||||
@subsection Appending Standard Output and Standard Error
|
||||
This construct allows both the
|
||||
@@ -2354,6 +2360,7 @@ This is semantically equivalent to
|
||||
@example
|
||||
>>@var{word} 2>&1
|
||||
@end example
|
||||
(see Duplicating File Descriptors below).
|
||||
|
||||
@subsection Here Documents
|
||||
This type of redirection instructs the shell to read input from the
|
||||
@@ -3361,10 +3368,13 @@ results in permissions of @code{755}.
|
||||
unset [-fv] [@var{name}]
|
||||
@end example
|
||||
Each variable or function @var{name} is removed.
|
||||
If no options are supplied, or the @option{-v} option is given, each
|
||||
@var{name} refers to a shell variable.
|
||||
If the @option{-v} option is given, each
|
||||
@var{name} refers to a shell variable and that variable is remvoved.
|
||||
If the @option{-f} option is given, the @var{name}s refer to shell
|
||||
functions, and the function definition is removed.
|
||||
If no options are supplied, each @var{name} refers to a variable; if
|
||||
there is no variable by that name, any function with that name is
|
||||
unset.
|
||||
Readonly variables and functions may not be unset.
|
||||
The return status is zero unless a @var{name} is readonly.
|
||||
@end table
|
||||
@@ -3641,7 +3651,7 @@ echo [-neE] [@var{arg} @dots{}]
|
||||
@end example
|
||||
Output the @var{arg}s, separated by spaces, terminated with a
|
||||
newline.
|
||||
The return status is always 0.
|
||||
The return status is 0 unless a write error occurs.
|
||||
If @option{-n} is specified, the trailing newline is suppressed.
|
||||
If the @option{-e} option is given, interpretation of the following
|
||||
backslash-escaped characters is enabled.
|
||||
@@ -4208,6 +4218,9 @@ the command name.
|
||||
|
||||
@item -m
|
||||
Job control is enabled (@pxref{Job Control}).
|
||||
All processes run in a separate process group.
|
||||
When a background job completes, the shell prints a line
|
||||
containing its exit status.
|
||||
|
||||
@item -n
|
||||
Read commands but do not execute them; this may be used to check a
|
||||
@@ -4945,7 +4958,8 @@ The shell function @code{$@{FUNCNAME[$i]@}} is defined in the file
|
||||
@code{$@{BASH_SOURCE[$i]@}} and called from @code{$@{BASH_SOURCE[$i+1]@}}
|
||||
|
||||
@item BASH_SUBSHELL
|
||||
Incremented by one each time a subshell or subshell environment is spawned.
|
||||
Incremented by one within each subshell or subshell environment when
|
||||
the shell begins executing in that environment.
|
||||
The initial value is 0.
|
||||
|
||||
@item BASH_VERSINFO
|
||||
@@ -6248,9 +6262,6 @@ name[@var{subscript}]=@var{value}
|
||||
@noindent
|
||||
The @var{subscript}
|
||||
is treated as an arithmetic expression that must evaluate to a number.
|
||||
If @var{subscript} evaluates to a number less than zero, it is used as
|
||||
an offset from one greater than the array's maximum index (so a subcript
|
||||
of -1 refers to the last element of the array).
|
||||
To explicitly declare an array, use
|
||||
@example
|
||||
declare -a @var{name}
|
||||
@@ -6317,6 +6328,11 @@ If @var{subscript} is @samp{@@} or
|
||||
@samp{*}, the expansion is the number of elements in the array.
|
||||
Referencing an array variable without a subscript is equivalent to
|
||||
referencing with a subscript of 0.
|
||||
If the @var{subscript}
|
||||
used to reference an element of an indexed array
|
||||
evaluates to a number less than zero, it is used as
|
||||
an offset from one greater than the array's maximum index (so a subcript
|
||||
of -1 refers to the last element of the array).
|
||||
|
||||
An array variable is considered set if a subscript has been assigned a
|
||||
value. The null string is a valid value.
|
||||
@@ -6729,6 +6745,10 @@ variable in a @code{for} statement or the selection variable in a
|
||||
@item
|
||||
Process substitution is not available.
|
||||
|
||||
@item
|
||||
While variable indirection is available, it may not be applied to the
|
||||
@samp{#} and @samp{?} special parameters.
|
||||
|
||||
@item
|
||||
Assignment statements preceding @sc{posix} special builtins
|
||||
persist in the shell environment after the builtin completes.
|
||||
|
||||
Reference in New Issue
Block a user