commit bash-20140919 snapshot

This commit is contained in:
Chet Ramey
2014-10-02 10:22:00 -04:00
parent 96f3fb6664
commit fc5270550f
23 changed files with 13207 additions and 13005 deletions
+62 -62
View File
@@ -21,10 +21,10 @@ DDEESSCCRRIIPPTTIIOONN
1003.1). BBaasshh can be configured to be POSIX-conformant by default.
OOPPTTIIOONNSS
All of the single-character shell options documented in the descrip-
tion of the sseett builtin command can be used as options when the shell
is invoked. In addition, bbaasshh interprets the following options when it
is invoked:
All of the single-character shell options documented in the description
of the sseett builtin command can be used as options when the shell is
invoked. In addition, bbaasshh interprets the following options when it is
invoked:
--cc If the --cc option is present, then commands are read from the
first non-option argument _c_o_m_m_a_n_d___s_t_r_i_n_g. If there are argu-
@@ -108,7 +108,7 @@ OOPPTTIIOONNSS
The shell becomes restricted (see RREESSTTRRIICCTTEEDD SSHHEELLLL below).
----vveerrbboossee
Equivalent to --vv.
Equivalent to --vv.
----vveerrssiioonn
Show version information for this instance of bbaasshh on the stan-
@@ -455,21 +455,21 @@ SSHHEELLLL GGRRAAMMMMAARR
each _p_a_t_t_e_r_n in turn, using the same matching rules as for path-
name expansion (see PPaatthhnnaammee EExxppaannssiioonn below). The _w_o_r_d is
expanded using tilde expansion, parameter and variable expan-
sion, arithmetic substitution, command substitution, process
substitution and quote removal. Each _p_a_t_t_e_r_n examined is
expanded using tilde expansion, parameter and variable expan-
sion, arithmetic substitution, command substitution, and process
substitution. If the shell option nnooccaasseemmaattcchh is enabled, the
match is performed without regard to the case of alphabetic
characters. When a match is found, the corresponding _l_i_s_t is
executed. If the ;;;; operator is used, no subsequent matches are
attempted after the first pattern match. Using ;;&& in place of
;;;; causes execution to continue with the _l_i_s_t associated with
the next set of patterns. Using ;;;;&& in place of ;;;; causes the
shell to test the next pattern list in the statement, if any,
and execute any associated _l_i_s_t 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 _l_i_s_t.
sion, arithmetic expansion, command substitution, process sub-
stitution and quote removal. Each _p_a_t_t_e_r_n examined is expanded
using tilde expansion, parameter and variable expansion, arith-
metic expansion, command substitution, and process substitution.
If the shell option nnooccaasseemmaattcchh is enabled, the match is per-
formed without regard to the case of alphabetic characters.
When a match is found, the corresponding _l_i_s_t is executed. If
the ;;;; operator is used, no subsequent matches are attempted
after the first pattern match. Using ;;&& in place of ;;;; causes
execution to continue with the _l_i_s_t associated with the next set
of patterns. Using ;;;;&& in place of ;;;; causes the shell to test
the next pattern list in the statement, if any, and execute any
associated _l_i_s_t 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 _l_i_s_t.
iiff _l_i_s_t; tthheenn _l_i_s_t; [ eelliiff _l_i_s_t; tthheenn _l_i_s_t; ] ... [ eellssee _l_i_s_t; ] ffii
The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn
@@ -680,26 +680,26 @@ PPAARRAAMMEETTEERRSS
and llooccaall below) to create a _n_a_m_e_r_e_f, or a reference to another vari-
able. This allows variables to be manipulated indirectly. Whenever
the nameref variable is referenced, assigned to, unset, or has its
attributes modified (other than the _n_a_m_e_r_e_f_P _a_t_t_r_i_b_u_t_e _i_t_s_e_l_f_)_, _t_h_e
_o_p_e_r_a_t_i_o_n _i_s _a_c_t_u_a_l_l_y _p_e_r_f_o_r_m_e_d _o_n _t_h_e _v_a_r_i_a_b_l_e _s_p_e_c_i_f_i_e_d _b_y _t_h_e
_n_a_m_e_r_e_f _v_a_r_i_a_b_l_e_'_s _v_a_l_u_e_. _A _n_a_m_e_r_e_f _i_s _c_o_m_m_o_n_l_y _u_s_e_d _w_i_t_h_i_n _s_h_e_l_l
_f_u_n_c_t_i_o_n_s _t_o _r_e_f_e_r _t_o _a _v_a_r_i_a_b_l_e _w_h_o_s_e _n_a_m_e _i_s _p_a_s_s_e_d _a_s _a_n _a_r_g_u_m_e_n_t _t_o
_t_h_e _f_u_n_c_t_i_o_n_. _F_o_r _i_n_s_t_a_n_c_e_, _i_f _a _v_a_r_i_a_b_l_e _n_a_m_e _i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_e _g_i_v_e_n _t_h_e 00mmeerreeff
_a_t_t_r_i_b_u_t_e_. _H_o_w_e_v_e_r_, _n_a_m_e_r_e_f _v_a_r_i_a_b_l_e_s _c_a_n _r_e_f_e_r_e_n_c_e _a_r_r_a_y _v_a_r_i_a_b_l_e_s
_a_n_d _s_u_b_s_c_r_i_p_t_e_d _a_r_r_a_y _v_a_r_i_a_b_l_e_s_. _N_a_m_e_r_e_f_s _c_a_n _b_e _u_n_s_e_t _u_s_i_n_g _t_h_e --nn
_o_p_t_i_o_n _t_o _t_h_e uunnsseett _b_u_i_l_t_i_n_. _O_t_h_e_r_w_i_s_e_, _i_f uunnsseett _i_s _e_x_e_c_u_t_e_d _w_i_t_h _t_h_e
_n_a_m_e _o_f _a _n_a_m_e_r_e_f _v_a_r_i_a_b_l_e _a_s _a_n _a_r_g_u_m_e_n_t_, _t_h_e _v_a_r_i_a_b_l_e _r_e_f_e_r_e_n_c_e_d _b_y
_t_h_e _n_a_m_e_r_e_f _v_a_r_i_a_b_l_e _w_i_l_l _b_e _u_n_s_e_t_.
attributes modified (other than the _n_a_m_e_r_e_f attribute itself), the
operation is actually performed on the variable specified by the
nameref variable's value. A nameref is commonly used within shell
functions to refer to a variable whose name is passed as an argument to
the function. For instance, if a variable name is passed to a shell
function as its first argument, running
declare -n ref=$1
inside the function creates a nameref variable rreeff whose value is the
variable name passed as the first argument. References and assignments
to rreeff, and changes to its attributes, are treated as references,
assignments, and attribute modifications to the variable whose name was
passed as $$11. If the control variable in a ffoorr loop has the nameref
attribute, the list of words can be a list of shell variables, and a
name reference will be established for each word in the list, in turn,
when the loop is executed. Array variables cannot be given the 00mmeerreeff
attribute. However, nameref variables can reference array variables
and subscripted array variables. Namerefs can be unset using the --nn
option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the
name of a nameref variable as an argument, the variable referenced by
the nameref variable will be unset.
PPoossiittiioonnaall PPaarraammeetteerrss
A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits,
@@ -1320,9 +1320,9 @@ PPAARRAAMMEETTEERRSS
explicitly declare an array. There is no maximum limit on the size of
an array, nor any requirement that members be indexed or assigned con-
tiguously. Indexed arrays are referenced using integers (including
arithmetic expressions) and are zero-based; associative arrays are
referenced using arbitrary strings. Unless otherwise noted, indexed
array indices must be non-negative integers.
arithmetic expressions) and are zero-based; associative arrays are ref-
erenced using arbitrary strings. Unless otherwise noted, indexed array
indices must be non-negative integers.
An indexed array is created automatically if any variable is assigned
to using the syntax _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e. The _s_u_b_s_c_r_i_p_t is treated as
@@ -2181,7 +2181,7 @@ FFUUNNCCTTIIOONNSS
tion while the function is executing.
All other aspects of the shell execution environment are identical
between a function and its caller with these exceptions: the DDEEBBUUGG and
between a function and its caller with these exceptions: the DDEEBBUUGG and
RREETTUURRNN traps (see the description of the ttrraapp builtin under SSHHEELLLL
BBUUIILLTTIINN CCOOMMMMAANNDDSS below) are not inherited unless the function has been
given the ttrraaccee attribute (see the description of the ddeeccllaarree builtin
@@ -2576,7 +2576,7 @@ EEXXIITT SSTTAATTUUSS
_w_a_i_t_p_i_d system call or equivalent function. Exit statuses fall between
0 and 255, though, as explained below, the shell may use values above
125 specially. Exit statuses from shell builtins and compound commands
are also limited to this range. Under certain circumstances, the shell
are also limited to this range. Under certain circumstances, the shell
will use special values to indicate specific failure modes.
For the shell's purposes, a command which exits with a zero exit status
@@ -2833,7 +2833,7 @@ RREEAADDLLIINNEE
RReeaaddlliinnee KKeeyy BBiinnddiinnggss
The syntax for controlling key bindings in the _i_n_p_u_t_r_c file is simple.
All that is required is the name of the command or the text of a macro
and a key sequence to which it should be bound. The name may be speci-
and a key sequence to which it should be bound. The name may be speci-
fied in one of two ways: as a symbolic key name, possibly with _M_e_t_a_- or
_C_o_n_t_r_o_l_- prefixes, or as a key sequence.
@@ -3545,7 +3545,7 @@ RREEAADDLLIINNEE
Without a numeric argument, the value of the readline ccoomm--
mmeenntt--bbeeggiinn variable is inserted at the beginning of the current
line. If a numeric argument is supplied, this command acts as a
toggle: if the characters at the beginning of the line do not
toggle: if the characters at the beginning of the line do not
match the value of ccoommmmeenntt--bbeeggiinn, the value is inserted, other-
wise the characters in ccoommmmeenntt--bbeeggiinn are deleted from the begin-
ning of the line. In either case, the line is accepted as if a
@@ -3927,7 +3927,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
AAlliiaass with no arguments or with the --pp option prints the list of
aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When
arguments are supplied, an alias is defined for each _n_a_m_e whose
_v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word
_v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word
to be checked for alias substitution when the alias is expanded.
For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup-
plied, the name and value of the alias is printed. AAlliiaass
@@ -4033,7 +4033,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
directory names in CCDDPPAATTHH are separated by a colon (:). A null
directory name in CCDDPPAATTHH is the same as the current directory,
i.e., ``..''. If _d_i_r begins with a slash (/), then CCDDPPAATTHH is not
used. The --PP option causes ccdd to use the physical directory
used. The --PP option causes ccdd to use the physical directory
structure by resolving symbolic links while traversing _d_i_r and
before processing instances of _._. in _d_i_r (see also the --PP option
to the sseett builtin command); the --LL option forces symbolic links
@@ -4934,18 +4934,18 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
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 above), exits with a non-zero sta-
tus. 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
final &&&& or ||||, any command in a pipeline but the last,
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
(see SSHHEELLLL GGRRAAMMMMAARR above), 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 final &&&&
or ||||, any command in a pipeline but the last, 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
above), and may cause subshells to exit before executing
@@ -5256,7 +5256,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
simulates a call to rreettuurrnn.
44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described
in their descriptions above.
55.. Function tracing is enabled: command substitu-
55.. Function tracing is enabled: command substitu-
tion, shell functions, and subshells invoked with
(( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps.
66.. Error tracing is enabled: command substitution,