commit bash-20170331 snapshot

This commit is contained in:
Chet Ramey
2017-04-03 10:31:01 -04:00
parent 124d67cde0
commit 7c4ef411b5
29 changed files with 1892 additions and 1549 deletions
+20 -9
View File
@@ -508,7 +508,7 @@ double quote
question mark
@item \@var{nnn}
the eight-bit character whose value is the octal value @var{nnn}
(one to three digits)
(one to three octal digits)
@item \x@var{HH}
the eight-bit character whose value is the hexadecimal value @var{HH}
(one or two hex digits)
@@ -659,8 +659,13 @@ the time information.
If the pipeline is not executed asynchronously (@pxref{Lists}), the
shell waits for all commands in the pipeline to complete.
Each command in a pipeline is executed in its own subshell
(@pxref{Command Execution Environment}). The exit
Each command in a pipeline is executed in its own subshell, which is a
separate process (@pxref{Command Execution Environment}).
If the @code{lastpipe} option is enabled using the @code{shopt} builtin
(@pxref{The Shopt Builtin}),
the last element of a pipeline may be run by the shell process.
The exit
status of a pipeline is the exit status of the last command in the
pipeline, unless the @code{pipefail} option is enabled
(@pxref{The Set Builtin}).
@@ -714,7 +719,7 @@ An @sc{and} list has the form
@noindent
@var{command2} is executed if, and only if, @var{command1}
returns an exit status of zero.
returns an exit status of zero (success).
An @sc{or} list has the form
@example
@@ -739,7 +744,7 @@ executed in the list.
* Command Grouping:: Ways to group commands.
@end menu
Compound commands are the shell programming constructs.
Compound commands are the shell programming language constructs.
Each construct begins with a reserved word or control operator and is
terminated by a corresponding reserved word or operator.
Any redirections (@pxref{Redirections}) associated with a compound command
@@ -798,12 +803,14 @@ The syntax of the @code{for} command is:
for @var{name} [ [in [@var{words} @dots{}] ] ; ] do @var{commands}; done
@end example
Expand @var{words}, and execute @var{commands} once for each member
Expand @var{words} (@pxref{Shell Expansions}), and execute @var{commands}
once for each member
in the resultant list, with @var{name} bound to the current member.
If @samp{in @var{words}} is not present, the @code{for} command
executes the @var{commands} once for each positional parameter that is
set, as if @samp{in "$@@"} had been specified
(@pxref{Special Parameters}).
The return status is the exit status of the last command that executes.
If there are no items in the expansion of @var{words}, no commands are
executed, and the return status is zero.
@@ -874,6 +881,8 @@ case @var{word} in [ [(] @var{pattern} [| @var{pattern}]@dots{}) @var{command-li
@code{case} will selectively execute the @var{command-list} corresponding to
the first @var{pattern} that matches @var{word}.
The match is performed according
to the rules described below in @ref{Pattern Matching}.
If the @code{nocasematch} shell option
(see the description of @code{shopt} in @ref{The Shopt Builtin})
is enabled, the match is performed without regard to the case
@@ -885,7 +894,9 @@ 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
substitution, arithmetic expansion, and quote removal
(@pxref{Shell Parameter Expansion})
before matching is
attempted. Each @var{pattern} undergoes tilde expansion, parameter
expansion, command substitution, and arithmetic expansion.
@@ -1045,7 +1056,7 @@ if there is a sequence of characters in the value consisting of
any number, including zero, of
space characters, zero or one instances of @samp{a}, then a @samp{b}:
@example
[[ $line =~ [[:space:]]*(a)?b ]]
[[ $line =~ [[:space:]]*?(a)b ]]
@end example
@noindent
@@ -1061,7 +1072,7 @@ expressions while paying attention to the shell's quote removal.
Using a shell variable to store the pattern decreases these problems.
For example, the following is equivalent to the above:
@example
pattern='[[:space:]]*(a)?b'
pattern='[[:space:]]*?(a)b'
[[ $line =~ $pattern ]]
@end example