fix for heuristic to detect case statements when parsing $() command substitutions to find history expansion; fix for history not being saved if a SIGHUP arrives during $PROMPT_COMMAND execution; workaround for Cygwin bug that results in bash incorrectly calculating the system pipe size

This commit is contained in:
Chet Ramey
2026-03-09 14:54:45 -04:00
parent d0b41c2c5f
commit 1f292e433e
16 changed files with 6183 additions and 366 deletions
+23 -21
View File
@@ -1927,34 +1927,36 @@ EEXXPPAANNSSIIOONN
In each of the cases below, _w_o_r_d is subject to tilde expansion, parame-
ter expansion, command substitution, and arithmetic expansion.
When not performing substring expansion, using the forms documented be-
low (e.g., ::--), bbaasshh tests for a parameter that is unset or null.
Omitting the colon tests only for a parameter that is unset.
When performing the first four expansions documented below (::--, ::==, ::??,
and ::++), including the colon, bbaasshh tests for a parameter that is unset
or null. Omitting the colon tests only for a parameter that is unset.
${_p_a_r_a_m_e_t_e_r::--_w_o_r_d}
UUssee DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the expan-
sion of _w_o_r_d is substituted. Otherwise, the value of _p_a_r_a_m_e_t_e_r
is substituted.
UUssee DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, or unset if
the colon is not present, the expansion of _w_o_r_d is substituted.
Otherwise, the value of _p_a_r_a_m_e_t_e_r is substituted.
${_p_a_r_a_m_e_t_e_r::==_w_o_r_d}
AAssssiiggnn DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the ex-
pansion of _w_o_r_d is assigned to _p_a_r_a_m_e_t_e_r, and the expansion is
the final value of _p_a_r_a_m_e_t_e_r. Positional parameters and special
parameters may not be assigned in this way.
AAssssiiggnn DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, or unset
if the colon is not present, the expansion of _w_o_r_d is assigned
to _p_a_r_a_m_e_t_e_r, and the expansion is the final value of _p_a_r_a_m_e_t_e_r.
Positional parameters and special parameters may not be assigned
in this way.
${_p_a_r_a_m_e_t_e_r::??_w_o_r_d}
DDiissppllaayy EErrrroorr iiff NNuullll oorr UUnnsseett. If _p_a_r_a_m_e_t_e_r is null or unset,
the shell writes the expansion of _w_o_r_d (or a message to that ef-
fect if _w_o_r_d is not present) to the standard error and, if it is
not interactive, exits with a non-zero status. An interactive
shell does not exit, but does not execute the command associated
with the expansion. Otherwise, the value of _p_a_r_a_m_e_t_e_r is sub-
stituted.
DDiissppllaayy EErrrroorr iiff NNuullll oorr UUnnsseett. If _p_a_r_a_m_e_t_e_r is unset or null,
or unset if the colon is not present, the shell writes the ex-
pansion of _w_o_r_d (or a message to that effect if _w_o_r_d is not
present) to the standard error and, if it is not interactive,
exits with a non-zero status. An interactive shell does not
exit, but does not execute the command associated with the ex-
pansion. Otherwise, the value of _p_a_r_a_m_e_t_e_r is substituted.
${_p_a_r_a_m_e_t_e_r::++_w_o_r_d}
UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is null or unset, nothing is
substituted, otherwise the expansion of _w_o_r_d is substituted.
The value of _p_a_r_a_m_e_t_e_r is not used.
UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is unset or null, or unset if
the colon is not present, nothing is substituted, otherwise the
expansion of _w_o_r_d is substituted. The value of _p_a_r_a_m_e_t_e_r is not
used.
${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t}
${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t::_l_e_n_g_t_h}
@@ -7618,4 +7620,4 @@ BBUUGGSS
Array variables may not (yet) be exported.
GNU Bash 5.3 2026 January 14 _B_A_S_H(1)
GNU Bash 5.3 2026 March 3 _B_A_S_H(1)