mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-11 22:20:49 +02:00
commit bash-20080522 snapshot
This commit is contained in:
+70
-16
@@ -5,12 +5,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Thu May 8 09:32:34 EDT 2008
|
||||
.\" Last Change: Sun May 25 10:41:29 EDT 2008
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2008 May 8" "GNU Bash-4.0"
|
||||
.TH BASH 1 "2008 May 25" "GNU Bash-4.0"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -471,8 +471,8 @@ A \fItoken\fP that performs a control function. It is one of the following
|
||||
symbols:
|
||||
.RS
|
||||
.PP
|
||||
.if t \fB\(bv\(bv & && ; ;; ( ) | <newline>\fP
|
||||
.if n \fB|| & && ; ;; ( ) | <newline>\fP
|
||||
.if t \fB\(bv\(bv & && ; ;; ( ) | |& <newline>\fP
|
||||
.if n \fB|| & && ; ;; ( ) | |& <newline>\fP
|
||||
.RE
|
||||
.PD
|
||||
.SH "RESERVED WORDS"
|
||||
@@ -507,12 +507,13 @@ The return value of a \fIsimple command\fP is its exit status, or
|
||||
.SS Pipelines
|
||||
.PP
|
||||
A \fIpipeline\fP is a sequence of one or more commands separated by
|
||||
the character
|
||||
.BR | .
|
||||
one of the control operators
|
||||
.B |
|
||||
or \fB|&\fP.
|
||||
The format for a pipeline is:
|
||||
.RS
|
||||
.PP
|
||||
[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ \fB|\fP \fIcommand2\fP ... ]
|
||||
[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ]
|
||||
.RE
|
||||
.PP
|
||||
The standard output of
|
||||
@@ -524,6 +525,11 @@ command (see
|
||||
.SM
|
||||
.B REDIRECTION
|
||||
below).
|
||||
If \fB|&\fP is used, the standard error of \fIcommand\fP is connected to
|
||||
\fIcommand2\fP's standard input through the pipe; it is shorthand for
|
||||
\fB2>&1 |\fP.
|
||||
This implicit redirection of the standard error is performed after any
|
||||
redirections specified by the command.
|
||||
.PP
|
||||
The return status of a pipeline is the exit status of the last
|
||||
command, unless the \fBpipefail\fP option is enabled.
|
||||
@@ -820,9 +826,15 @@ If the shell option
|
||||
.B nocasematch
|
||||
is enabled, the match is performed without regard to the case
|
||||
of alphabetic characters.
|
||||
When a match is found, the
|
||||
corresponding \fIlist\fP is executed. After the first match, no
|
||||
subsequent matches are attempted. The exit status is zero if no
|
||||
When a match is found, the corresponding \fIlist\fP is executed.
|
||||
If the \fB;;\fP operator is used, no subsequent matches are attempted after
|
||||
the first pattern match.
|
||||
Using \fB;&\fP in place of \fB;;\fP causes execution to continue with
|
||||
the \fIlist\fP associated with the next set of patterns.
|
||||
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
|
||||
on a successful match.
|
||||
The exit status is zero if no
|
||||
pattern matches. Otherwise, it is the exit status of the
|
||||
last command executed in \fIlist\fP.
|
||||
.TP
|
||||
@@ -2224,13 +2236,21 @@ Brace expansions may be nested. The results of each expanded
|
||||
string are not sorted; left to right order is preserved.
|
||||
For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'.
|
||||
.PP
|
||||
A sequence expression takes the form \fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB}\fP,
|
||||
where \fIx\fP and \fIy\fP are either integers or single characters.
|
||||
A sequence expression takes the form
|
||||
\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fIincr\fP]}\fP,
|
||||
where \fIx\fP and \fIy\fP are either integers or single characters,
|
||||
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.
|
||||
Supplied integers may be prefixed with \fI0\fP to force each term to have the
|
||||
same width. 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 characters are supplied, the expression expands to each character
|
||||
lexicographically between \fIx\fP and \fIy\fP, inclusive. Note that
|
||||
both \fIx\fP and \fIy\fP must be of the same type.
|
||||
When the increment is supplied, it is used as the difference between
|
||||
each term. The default increment is 1 or -1 as appropriate.
|
||||
.PP
|
||||
Brace expansion is performed before any other expansions,
|
||||
and any characters special to other expansions are preserved
|
||||
@@ -3141,14 +3161,12 @@ The general format for appending output is:
|
||||
.PP
|
||||
.SS Redirecting Standard Output and Standard Error
|
||||
.PP
|
||||
.B Bash
|
||||
allows both the
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be redirected to the file whose name is the
|
||||
expansion of
|
||||
.I word
|
||||
with this construct.
|
||||
.IR word .
|
||||
.PP
|
||||
There are two formats for redirecting standard output and
|
||||
standard error:
|
||||
@@ -3167,6 +3185,27 @@ This is semantically equivalent to
|
||||
.PP
|
||||
\fB>\fP\fIword\fP 2\fB>&\fP1
|
||||
.RE
|
||||
.PP
|
||||
.SS Appending Standard Output and Standard Error
|
||||
.PP
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be appended to the file whose name is the
|
||||
expansion of
|
||||
.IR word .
|
||||
.PP
|
||||
The format for appending standard output and standard error is:
|
||||
.RS
|
||||
.PP
|
||||
\fB&>>\fP\fIword\fP
|
||||
.RE
|
||||
.PP
|
||||
This is semantically equivalent to
|
||||
.RS
|
||||
.PP
|
||||
\fB>>\fP\fIword\fP 2\fB>&\fP1
|
||||
.RE
|
||||
.SS Here Documents
|
||||
.PP
|
||||
This type of redirection instructs the shell to read input from the
|
||||
@@ -5338,6 +5377,11 @@ Attempt completion on the text before point, comparing
|
||||
the text against lines from the history list for possible
|
||||
completion matches.
|
||||
.TP
|
||||
.B dabbrev\-expand
|
||||
Attempt menu completion on the text before point, comparing
|
||||
the text against lines from the history list for possible
|
||||
completion matches.
|
||||
.TP
|
||||
.B complete\-into\-braces (M\-{)
|
||||
Perform filename completion and insert the list of possible completions
|
||||
enclosed within braces so the list is available to the shell (see
|
||||
@@ -6175,6 +6219,16 @@ Remove any current binding for \fIkeyseq\fP.
|
||||
.B \-x \fIkeyseq\fP:\fIshell\-command\fP
|
||||
Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is
|
||||
entered.
|
||||
When \fIshell\-command\fP is executed, the shell sets the
|
||||
.B READLINE_LINE
|
||||
variable to the contents of the \fBreadline\fP line buffer and the
|
||||
.B READLINE_POINT
|
||||
variable to the current location of the insertion point.
|
||||
If the executed command changes the value of
|
||||
.B READLINE_LINE
|
||||
or
|
||||
.BR READLINE_POINT ,
|
||||
those new values will be reflected in the editing state.
|
||||
.PD
|
||||
.PP
|
||||
The return value is 0 unless an unrecognized option is given or an
|
||||
|
||||
+74
-24
@@ -5,12 +5,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Thu May 8 09:32:34 EDT 2008
|
||||
.\" Last Change: Sun May 25 10:41:29 EDT 2008
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2008 May 8" "GNU Bash-4.0"
|
||||
.TH BASH 1 "2008 May 25" "GNU Bash-4.0"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -471,8 +471,8 @@ A \fItoken\fP that performs a control function. It is one of the following
|
||||
symbols:
|
||||
.RS
|
||||
.PP
|
||||
.if t \fB\(bv\(bv & && ; ;; ( ) | <newline>\fP
|
||||
.if n \fB|| & && ; ;; ( ) | <newline>\fP
|
||||
.if t \fB\(bv\(bv & && ; ;; ( ) | |& <newline>\fP
|
||||
.if n \fB|| & && ; ;; ( ) | |& <newline>\fP
|
||||
.RE
|
||||
.PD
|
||||
.SH "RESERVED WORDS"
|
||||
@@ -507,12 +507,13 @@ The return value of a \fIsimple command\fP is its exit status, or
|
||||
.SS Pipelines
|
||||
.PP
|
||||
A \fIpipeline\fP is a sequence of one or more commands separated by
|
||||
the character
|
||||
.BR | .
|
||||
one of the control operators
|
||||
.B |
|
||||
or \fB|&\fP.
|
||||
The format for a pipeline is:
|
||||
.RS
|
||||
.PP
|
||||
[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ \fB|\fP \fIcommand2\fP ... ]
|
||||
[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ]
|
||||
.RE
|
||||
.PP
|
||||
The standard output of
|
||||
@@ -524,6 +525,11 @@ command (see
|
||||
.SM
|
||||
.B REDIRECTION
|
||||
below).
|
||||
If \fB|&\fP is used, the standard error of \fIcommand\fP is connected to
|
||||
\fIcommand2\fP's standard input through the pipe; it is shorthand for
|
||||
\fB2>&1 |\fP.
|
||||
This implicit redirection of the standard error is performed after any
|
||||
redirections specified by the command.
|
||||
.PP
|
||||
The return status of a pipeline is the exit status of the last
|
||||
command, unless the \fBpipefail\fP option is enabled.
|
||||
@@ -820,9 +826,15 @@ If the shell option
|
||||
.B nocasematch
|
||||
is enabled, the match is performed without regard to the case
|
||||
of alphabetic characters.
|
||||
When a match is found, the
|
||||
corresponding \fIlist\fP is executed. After the first match, no
|
||||
subsequent matches are attempted. The exit status is zero if no
|
||||
When a match is found, the corresponding \fIlist\fP is executed.
|
||||
If the \fB;;\fP operator is used, no subsequent matches are attempted after
|
||||
the first pattern match.
|
||||
Using \fB;&\fP in place of \fB;;\fP causes execution to continue with
|
||||
the \fIlist\fP associated with the next set of patterns.
|
||||
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
|
||||
on a successful match.
|
||||
The exit status is zero if no
|
||||
pattern matches. Otherwise, it is the exit status of the
|
||||
last command executed in \fIlist\fP.
|
||||
.TP
|
||||
@@ -2224,13 +2236,21 @@ Brace expansions may be nested. The results of each expanded
|
||||
string are not sorted; left to right order is preserved.
|
||||
For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'.
|
||||
.PP
|
||||
A sequence expression takes the form \fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB}\fP,
|
||||
where \fIx\fP and \fIy\fP are either integers or single characters.
|
||||
A sequence expression takes the form
|
||||
\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fIincr\fP]}\fP,
|
||||
where \fIx\fP and \fIy\fP are either integers or single characters,
|
||||
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.
|
||||
Supplied integers may be prefixed with \fI0\fP to force each term to have the
|
||||
same width. 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 characters are supplied, the expression expands to each character
|
||||
lexicographically between \fIx\fP and \fIy\fP, inclusive. Note that
|
||||
both \fIx\fP and \fIy\fP must be of the same type.
|
||||
When the increment is supplied, it is used as the difference between
|
||||
each term. The default increment is 1 or -1 as appropriate.
|
||||
.PP
|
||||
Brace expansion is performed before any other expansions,
|
||||
and any characters special to other expansions are preserved
|
||||
@@ -3141,14 +3161,12 @@ The general format for appending output is:
|
||||
.PP
|
||||
.SS Redirecting Standard Output and Standard Error
|
||||
.PP
|
||||
.B Bash
|
||||
allows both the
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be redirected to the file whose name is the
|
||||
expansion of
|
||||
.I word
|
||||
with this construct.
|
||||
.IR word .
|
||||
.PP
|
||||
There are two formats for redirecting standard output and
|
||||
standard error:
|
||||
@@ -3167,6 +3185,27 @@ This is semantically equivalent to
|
||||
.PP
|
||||
\fB>\fP\fIword\fP 2\fB>&\fP1
|
||||
.RE
|
||||
.PP
|
||||
.SS Appending Standard Output and Standard Error
|
||||
.PP
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be appended to the file whose name is the
|
||||
expansion of
|
||||
.IR word .
|
||||
.PP
|
||||
The format for appending standard output and standard error is:
|
||||
.RS
|
||||
.PP
|
||||
\fB&>>\fP\fIword\fP
|
||||
.RE
|
||||
.PP
|
||||
This is semantically equivalent to
|
||||
.RS
|
||||
.PP
|
||||
\fB>>\fP\fIword\fP 2\fB>&\fP1
|
||||
.RE
|
||||
.SS Here Documents
|
||||
.PP
|
||||
This type of redirection instructs the shell to read input from the
|
||||
@@ -5338,6 +5377,11 @@ Attempt completion on the text before point, comparing
|
||||
the text against lines from the history list for possible
|
||||
completion matches.
|
||||
.TP
|
||||
.B dabbrev\-expand
|
||||
Attempt menu completion on the text before point, comparing
|
||||
the text against lines from the history list for possible
|
||||
completion matches.
|
||||
.TP
|
||||
.B complete\-into\-braces (M\-{)
|
||||
Perform filename completion and insert the list of possible completions
|
||||
enclosed within braces so the list is available to the shell (see
|
||||
@@ -6175,6 +6219,16 @@ Remove any current binding for \fIkeyseq\fP.
|
||||
.B \-x \fIkeyseq\fP:\fIshell\-command\fP
|
||||
Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is
|
||||
entered.
|
||||
When \fIshell\-command\fP is executed, the shell sets the
|
||||
.B READLINE_LINE
|
||||
variable to the contents of the \fBreadline\fP line buffer and the
|
||||
.B READLINE_POINT
|
||||
variable to the current location of the insertion point.
|
||||
If the executed command changes the value of
|
||||
.B READLINE_LINE
|
||||
or
|
||||
.BR READLINE_POINT ,
|
||||
those new values will be reflected in the editing state.
|
||||
.PD
|
||||
.PP
|
||||
The return value is 0 unless an unrecognized option is given or an
|
||||
@@ -6193,10 +6247,8 @@ loop. If \fIn\fP is specified, break \fIn\fP levels.
|
||||
must be \(>= 1. If
|
||||
.I n
|
||||
is greater than the number of enclosing loops, all enclosing loops
|
||||
are exited. The return value is 0 unless the shell is not executing
|
||||
a loop when
|
||||
.B break
|
||||
is executed.
|
||||
are exited.
|
||||
The return value is 0 unless \fIn\fP is not greater than or equal to 1.
|
||||
.TP
|
||||
\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP]
|
||||
Execute the specified shell builtin, passing it
|
||||
@@ -6552,10 +6604,8 @@ is specified, resume at the \fIn\fPth enclosing loop.
|
||||
must be \(>= 1. If
|
||||
.I n
|
||||
is greater than the number of enclosing loops, the last enclosing loop
|
||||
(the ``top-level'' loop) is resumed. The return value is 0 unless the
|
||||
shell is not executing a loop when
|
||||
.B continue
|
||||
is executed.
|
||||
(the ``top-level'' loop) is resumed.
|
||||
The return value is 0 unless \fIn\fP is not greater than or equal to 1.
|
||||
.TP
|
||||
\fBdeclare\fP [\fB\-afFirtx\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...]
|
||||
.PD 0
|
||||
|
||||
+61
-12
@@ -229,7 +229,7 @@ than by an executable program somewhere in the file system.
|
||||
A @code{token} that performs a control function. It is a @code{newline}
|
||||
or one of the following:
|
||||
@samp{||}, @samp{&&}, @samp{&}, @samp{;}, @samp{;;},
|
||||
@samp{|}, @samp{(}, or @samp{)}.
|
||||
@samp{|}, @samp{|&}, @samp{(}, or @samp{)}.
|
||||
|
||||
@item exit status
|
||||
@cindex exit status
|
||||
@@ -606,21 +606,28 @@ the command was terminated by signal @var{n}.
|
||||
@cindex pipeline
|
||||
@cindex commands, pipelines
|
||||
|
||||
A @code{pipeline} is a sequence of simple commands separated by
|
||||
@samp{|}.
|
||||
A @code{pipeline} is a sequence of simple commands separated by one of
|
||||
the control operators @samp{|} or @samp{|&}.
|
||||
|
||||
@rwindex time
|
||||
@rwindex !
|
||||
@cindex command timing
|
||||
The format for a pipeline is
|
||||
@example
|
||||
[@code{time} [@code{-p}]] [@code{!}] @var{command1} [@code{|} @var{command2} @dots{}]
|
||||
[@code{time} [@code{-p}]] [@code{!}] @var{command1} [ [@code{|} or @code{|&}] @var{command2} @dots{}]
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
The output of each command in the pipeline is connected via a pipe
|
||||
to the input of the next command.
|
||||
That is, each command reads the previous command's output.
|
||||
That is, each command reads the previous command's output. This
|
||||
connection is performed before any redirections specified by the
|
||||
command.
|
||||
|
||||
If @samp{|&} is used, the standard error of @var{command1} is connected to
|
||||
@var{command2}'s standard input through the pipe; it is shorthand for
|
||||
@code{2>&1 |}. This implicit redirection of the standard error is
|
||||
performed after any redirections specified by the command.
|
||||
|
||||
The reserved word @code{time} causes timing statistics
|
||||
to be printed for the pipeline once it finishes.
|
||||
@@ -852,14 +859,17 @@ of alphabetic characters.
|
||||
The @samp{|} is used to separate multiple patterns, and the @samp{)}
|
||||
operator terminates a pattern list.
|
||||
A list of patterns and an associated command-list is known
|
||||
as a @var{clause}. Each clause must be terminated with @samp{;;}.
|
||||
as a @var{clause}.
|
||||
|
||||
Each clause must be terminated with @samp{;;}, @samp{,&}, or @samp{;;&}.
|
||||
The @var{word} undergoes tilde expansion, parameter expansion, command
|
||||
substitution, arithmetic expansion, and quote removal before matching is
|
||||
attempted. Each @var{pattern} undergoes tilde expansion, parameter
|
||||
expansion, command substitution, and arithmetic expansion.
|
||||
|
||||
There may be an arbitrary number of @code{case} clauses, each terminated
|
||||
by a @samp{;;}. The first pattern that matches determines the
|
||||
by a @samp{;;}, @samp{;&}, or @samp{;;&}.
|
||||
The first pattern that matches determines the
|
||||
command-list that is executed.
|
||||
|
||||
Here is an example using @code{case} in a script that could be used to
|
||||
@@ -878,6 +888,15 @@ echo " legs."
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
|
||||
If the @samp{;;} operator is used, no subsequent matches are attempted after
|
||||
the first pattern match.
|
||||
Using @samp{;&} in place of @samp{;;} causes execution to continue with
|
||||
the @var{command-list} associated with the next clause, if any.
|
||||
Using @samp{;;&} in place of @samp{;;} causes the shell to test the patterns
|
||||
in the next clause, if any, and execute any associated @var{command-list}
|
||||
on a successful match.
|
||||
|
||||
The return status is zero if no @var{pattern} is matched. Otherwise, the
|
||||
return status is the exit status of the @var{command-list} executed.
|
||||
|
||||
@@ -1395,13 +1414,20 @@ bash$ echo a@{d,c,b@}e
|
||||
ade ace abe
|
||||
@end example
|
||||
|
||||
A sequence expression takes the form @code{@{@var{x}..@var{y}@}},
|
||||
where @var{x} and @var{y} are either integers or single characters.
|
||||
A sequence expression takes the form @code{@{@var{x}..@var{y}[@var{incr}]@}},
|
||||
where @var{x} and @var{y} are either integers or single characters,
|
||||
and @var{incr}, an optional increment, is an integer.
|
||||
When integers are supplied, the expression expands to each number between
|
||||
@var{x} and @var{y}, inclusive.
|
||||
Supplied integers may be prefixed with @samp{0} to force each term to have the
|
||||
same width. When either @var{x} or @var{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 characters are supplied, the expression expands to each character
|
||||
lexicographically between @var{x} and @var{y}, inclusive. Note that
|
||||
both @var{x} and @var{y} must be of the same type.
|
||||
When the increment is supplied, it is used as the difference between
|
||||
each term. The default increment is 1 or -1 as appropriate.
|
||||
|
||||
Brace expansion is performed before any other expansions,
|
||||
and any characters special to other expansions are preserved
|
||||
@@ -2094,11 +2120,11 @@ The general format for appending output is:
|
||||
@end example
|
||||
|
||||
@subsection Redirecting Standard Output and Standard Error
|
||||
Bash allows both the
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be redirected to the file whose name is the
|
||||
expansion of @var{word} with this construct.
|
||||
expansion of @var{word}.
|
||||
|
||||
There are two formats for redirecting standard output and
|
||||
standard error:
|
||||
@@ -2117,6 +2143,23 @@ This is semantically equivalent to
|
||||
>@var{word} 2>&1
|
||||
@end example
|
||||
|
||||
@subsection Appending Standard Output and Standard Error
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be appended to the file whose name is the
|
||||
expansion of @var{word}.
|
||||
|
||||
The format for appending standard output and standard error is:
|
||||
@example
|
||||
&>>@var{word}
|
||||
@end example
|
||||
@noindent
|
||||
This is semantically equivalent to
|
||||
@example
|
||||
>>@var{word} 2>&1
|
||||
@end example
|
||||
|
||||
@subsection Here Documents
|
||||
This type of redirection instructs the shell to read input from the
|
||||
current source until a line containing only @var{word}
|
||||
@@ -3202,7 +3245,13 @@ Remove any current binding for @var{keyseq}.
|
||||
@item -x @var{keyseq:shell-command}
|
||||
Cause @var{shell-command} to be executed whenever @var{keyseq} is
|
||||
entered.
|
||||
|
||||
When @var{shell-command} is executed, the shell sets the
|
||||
@code{READLINE_LINE} variable to the contents of the Readline line
|
||||
buffer and the @code{READLINE_POINT} variable to the current location
|
||||
of the insertion point.
|
||||
If the executed command changes the value of @code{READLINE_LINE} or
|
||||
@code{READLINE_POINT}, those new values will be reflected in the
|
||||
editing state.
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
|
||||
+49
-10
@@ -229,7 +229,7 @@ than by an executable program somewhere in the file system.
|
||||
A @code{token} that performs a control function. It is a @code{newline}
|
||||
or one of the following:
|
||||
@samp{||}, @samp{&&}, @samp{&}, @samp{;}, @samp{;;},
|
||||
@samp{|}, @samp{(}, or @samp{)}.
|
||||
@samp{|}, @samp{|&}, @samp{(}, or @samp{)}.
|
||||
|
||||
@item exit status
|
||||
@cindex exit status
|
||||
@@ -606,21 +606,28 @@ the command was terminated by signal @var{n}.
|
||||
@cindex pipeline
|
||||
@cindex commands, pipelines
|
||||
|
||||
A @code{pipeline} is a sequence of simple commands separated by
|
||||
@samp{|}.
|
||||
A @code{pipeline} is a sequence of simple commands separated by one of
|
||||
the control operators @samp{|} or @samp{|&}.
|
||||
|
||||
@rwindex time
|
||||
@rwindex !
|
||||
@cindex command timing
|
||||
The format for a pipeline is
|
||||
@example
|
||||
[@code{time} [@code{-p}]] [@code{!}] @var{command1} [@code{|} @var{command2} @dots{}]
|
||||
[@code{time} [@code{-p}]] [@code{!}] @var{command1} [ [@code{|} or @code{|&}] @var{command2} @dots{}]
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
The output of each command in the pipeline is connected via a pipe
|
||||
to the input of the next command.
|
||||
That is, each command reads the previous command's output.
|
||||
That is, each command reads the previous command's output. This
|
||||
connection is performed before any redirections specified by the
|
||||
command.
|
||||
|
||||
If @samp{|&} is used, the standard error of @var{command1} is connected to
|
||||
@var{command2}'s standard input through the pipe; it is shorthand for
|
||||
@code{2>&1 |}. This implicit redirection of the standard error is
|
||||
performed after any redirections specified by the command.
|
||||
|
||||
The reserved word @code{time} causes timing statistics
|
||||
to be printed for the pipeline once it finishes.
|
||||
@@ -1395,13 +1402,20 @@ bash$ echo a@{d,c,b@}e
|
||||
ade ace abe
|
||||
@end example
|
||||
|
||||
A sequence expression takes the form @code{@{@var{x}..@var{y}@}},
|
||||
where @var{x} and @var{y} are either integers or single characters.
|
||||
A sequence expression takes the form @code{@{@var{x}..@var{y}[@var{incr}]@}},
|
||||
where @var{x} and @var{y} are either integers or single characters,
|
||||
and @var{incr}, an optional increment, is an integer.
|
||||
When integers are supplied, the expression expands to each number between
|
||||
@var{x} and @var{y}, inclusive.
|
||||
Supplied integers may be prefixed with @samp{0} to force each term to have the
|
||||
same width. When either @var{x} or @var{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 characters are supplied, the expression expands to each character
|
||||
lexicographically between @var{x} and @var{y}, inclusive. Note that
|
||||
both @var{x} and @var{y} must be of the same type.
|
||||
When the increment is supplied, it is used as the difference between
|
||||
each term. The default increment is 1 or -1 as appropriate.
|
||||
|
||||
Brace expansion is performed before any other expansions,
|
||||
and any characters special to other expansions are preserved
|
||||
@@ -2094,11 +2108,11 @@ The general format for appending output is:
|
||||
@end example
|
||||
|
||||
@subsection Redirecting Standard Output and Standard Error
|
||||
Bash allows both the
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be redirected to the file whose name is the
|
||||
expansion of @var{word} with this construct.
|
||||
expansion of @var{word}.
|
||||
|
||||
There are two formats for redirecting standard output and
|
||||
standard error:
|
||||
@@ -2117,6 +2131,23 @@ This is semantically equivalent to
|
||||
>@var{word} 2>&1
|
||||
@end example
|
||||
|
||||
@subsection Appending Standard Output and Standard Error
|
||||
This construct allows both the
|
||||
standard output (file descriptor 1) and
|
||||
the standard error output (file descriptor 2)
|
||||
to be appended to the file whose name is the
|
||||
expansion of @var{word}.
|
||||
|
||||
The format for appending standard output and standard error is:
|
||||
@example
|
||||
&>>@var{word}
|
||||
@end example
|
||||
@noindent
|
||||
This is semantically equivalent to
|
||||
@example
|
||||
>>@var{word} 2>&1
|
||||
@end example
|
||||
|
||||
@subsection Here Documents
|
||||
This type of redirection instructs the shell to read input from the
|
||||
current source until a line containing only @var{word}
|
||||
@@ -3202,7 +3233,13 @@ Remove any current binding for @var{keyseq}.
|
||||
@item -x @var{keyseq:shell-command}
|
||||
Cause @var{shell-command} to be executed whenever @var{keyseq} is
|
||||
entered.
|
||||
|
||||
When @var{shell-command} is executed, the shell sets the
|
||||
@code{READLINE_LINE} variable to the contents of the Readline line
|
||||
buffer and the @code{READLINE_POINT} variable to the current location
|
||||
of the insertion point.
|
||||
If the executed command changes the value of @code{READLINE_LINE} or
|
||||
@code{READLINE_POINT}, those new values will be reflected in the
|
||||
editing state.
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
@@ -3610,6 +3647,8 @@ not echoed.
|
||||
@item -t @var{timeout}
|
||||
Cause @code{read} to time out and return failure if a complete line of
|
||||
input is not read within @var{timeout} seconds.
|
||||
@var{timeout} may be a decimal number with a fractional portion following
|
||||
the decimal point.
|
||||
This option has no effect if @code{read} is not reading input from the
|
||||
terminal or a pipe.
|
||||
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 1988-2008 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Sun May 4 22:23:58 EDT 2008
|
||||
@set LASTCHANGE Sun May 25 10:48:26 EDT 2008
|
||||
|
||||
@set EDITION 4.0
|
||||
@set VERSION 4.0
|
||||
@set UPDATED 4 May 2008
|
||||
@set UPDATED 25 May 2008
|
||||
@set UPDATED-MONTH May 2008
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 1988-2008 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Fri Apr 25 12:33:01 EDT 2008
|
||||
@set LASTCHANGE Sun May 4 22:23:58 EDT 2008
|
||||
|
||||
@set EDITION 4.0
|
||||
@set VERSION 4.0
|
||||
@set UPDATED 25 April 2008
|
||||
@set UPDATED-MONTH April 2008
|
||||
@set UPDATED 4 May 2008
|
||||
@set UPDATED-MONTH May 2008
|
||||
|
||||
Reference in New Issue
Block a user