Bash-5.3-rc2 release

This commit is contained in:
Chet Ramey
2025-06-02 12:05:51 -04:00
parent c8f067a967
commit 102140e4c4
146 changed files with 21928 additions and 19439 deletions
+7
View File
@@ -74,6 +74,13 @@ z x v t r p n l j h f d b
{a..1} {a..2} {a..3} {a..4} {c..1} {c..2} {c..3} {c..4}
{1..4} {2..4} {3..4}
{6..7} {6..8} {6..9}
a ../a.cfg
a.. /a.cfg
a..b /a.cfg
a b../a.cfg
1..4 5..8
1..4 8
1 5..8
{abcde.f}
X{..a}Z
0{1..}2
+10
View File
@@ -141,6 +141,16 @@ echo {{a,c}..{1..4}}
echo {{1,2,3}..4}
echo {6..{7,8,9}}
# these are not valid sequence expressions but are valid brace expansions
echo {a,../a.cfg}
echo {a..,/a.cfg}
echo {a..b,/a.cfg}
echo {a,b../a.cfg}
echo {1..4,5..8}
echo {1..4,8}
echo {1,5..8}
# these are all invalid brace expansions
echo {abcde.f}
+22
View File
@@ -372,3 +372,25 @@ d
5 history
./history8.sub: line 15: history: 72: history position out of range
./history8.sub: line 16: history: -72: history position out of range
1 echo below zero
2 cat <<EOF
a
b
c
set -o vi
a
bbb
exit
EOF
3 echo one # leading blank lines get removed
4 echo two # blank lines after a non-blank are preserved
5 echo three
+1
View File
@@ -134,3 +134,4 @@ ${THIS_SH} ./history5.sub
${THIS_SH} ./history6.sub
${THIS_SH} ./history7.sub
${THIS_SH} ./history8.sub
${THIS_SH} ./history9.sub
+2
View File
@@ -14,3 +14,5 @@ history
history -d 72
history -d -72
unset HISTFILE
+57
View File
@@ -0,0 +1,57 @@
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
: ${TMPDIR:=/tmp}
HFNAME=$TMPDIR/histfile-$$
trap 'rm -f "$HFNAME"' 0 1 2 3 6 15
cat <<EOFILE >$HFNAME
#1
echo below zero
#12302430
cat <<EOF
a
b
c
set -o vi
a
bbb
exit
EOF
#2
echo one # leading blank lines get removed
#2811
echo two # blank lines after a non-blank are preserved
#2814
echo three
EOFILE
shopt -s cmdhist
HISTTIMEFORMAT=
HISTFILE=$HFNAME
history -c
history -r
history
unset HISTFILE
+15 -3
View File
@@ -535,16 +535,16 @@ declare -ai a=([0]="5")
declare -ai a=([0]="6")
declare -ai a=([0]="42")
declare -ai a=([0]="1")
./nameref23.sub: line 16: declare: b: not found
./nameref23.sub: line 29: declare: b: not found
declare -ai a=([0]="1")
declare -- b="1"
declare -ai a=([0]="1")
declare -- b="11"
declare -ai a=([0]="1")
declare -- b="110"
./nameref23.sub: line 26: declare: `1': invalid variable name for name reference
./nameref23.sub: line 39: declare: `1': invalid variable name for name reference
declare -ai a=([0]="1")
./nameref23.sub: line 28: declare: b: not found
./nameref23.sub: line 41: declare: b: not found
declare -ai a=([0]="4")
declare -in b="a[0]"
declare -ai a=([0]="6")
@@ -574,3 +574,15 @@ declare -ai a=([0]="0" [1]="16")
3
3
5
bash: line 1: a[k]: unbound variable
ok 1
bash: line 1: r0: unbound variable
ok 2
bash: line 1: r: unbound variable
ok 3
bash: line 1: k: unbound variable
ok 4
ok 5
ok 6
ok 7
ok 8
+13
View File
@@ -1,3 +1,16 @@
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
declare -ai a
a[0]=4
declare -n b='a[0]'
+12
View File
@@ -0,0 +1,12 @@
# issues with nounset and references to nameref variables whose value
# contains an unset variable
$THIS_SH -uc 'a=() k=; "${a[k]}"' bash || echo ok 1
$THIS_SH -uc 'declare -n r0=b ; : "$r0"' bash || echo ok 2
$THIS_SH -uc 'a=() k=; declare -n r='a[k]' ; : "$r"' bash || echo ok 3
$THIS_SH -uc 'declare -n r='a[k]' ; : "$r"' bash || echo ok 4
$THIS_SH -uc 'a=() k=; declare -n r='a[@]' ; : "$r"' bash && echo ok 5
$THIS_SH -uc 'declare -n r='a[@]' ; : "$r"' bash && echo ok 6
$THIS_SH -uc 'a=() k=; declare -n r='a[*]' ; : "$r"' bash && echo ok 7
$THIS_SH -uc 'declare -n r='a[*]' ; : "$r"' bash && echo ok 8
+14
View File
@@ -38,6 +38,20 @@ xyz
a = xyz
a = -xyz 123-
a = abc
<A>
<$'B\315'>
<$'C\226'>
<A>
<$'B\315'>
<$'C\226'>
<winter>
<spring>
<$'summer\200apple\200banana\200cherry'>
<automn>
<winter>
<$'spring\375'>
<summer>
<automn>
timeout 1: ok
unset or null 1
timeout 2: ok
+22
View File
@@ -34,4 +34,26 @@ echo abcd | {
echo a = $a
}
# incomplete and invalid multibyte characters followed by the delimiter
printf 'A\0B\315\0C\226\0' | while IFS= read -rd '' f; do printf '<%q>\n' "$f"; done
printf 'A\nB\315\nC\226\n' | while IFS= read -r f; do printf '<%q>\n' "$f"; done
printf '%b\0' winter spring 'summer\0200apple\0200banana\0200cherry' automn |
while IFS= read -rd "" season; do LC_ALL=C printf "<%q>\n" "$season"; done
printf '%b\200' winter 'spring\0375' summer automn |
while IFS= read -rd $'\200' season; do LC_ALL=C printf "<%q>\n" "$season"; done
# this test is encoding-dependent, and varies from system to system
#: ${TMPDIR:=/tmp}
#INFILE=$TMPDIR/read-in-$$
#printf '%b\243' winter 'spring\0375' '\0277summer' '\0277' automn > $INFILE
#
#LANG=zh_HK.big5hkscs
#while IFS= read -rd $'\243' season; do
# LC_ALL=C printf "<%q>\n" "$season"
#done < $INFILE
#
#rm -f $INFILE
exit 0