Bash-5.2-rc2 release

This commit is contained in:
Chet Ramey
2022-07-25 13:33:03 -04:00
parent 6c1407d2a9
commit f36c8c8ecd
77 changed files with 12062 additions and 10024 deletions
+2
View File
@@ -41,3 +41,5 @@ baz
foo
bar
baz
<áa>
<aá>
+1
View File
@@ -62,3 +62,4 @@ ${THIS_SH} ./alias2.sub
${THIS_SH} ./alias3.sub
${THIS_SH} ./alias4.sub
${THIS_SH} ./alias5.sub
${THIS_SH} ./alias6.sub
+13
View File
@@ -0,0 +1,13 @@
# make sure aliases that end in multibyte characters don't interfere with the
# space sentinel alias expansion adds; problem through bash-5.1
shopt -s expand_aliases
LC_ALL=en_US.UTF-8
alias a1='printf "<%s>\\n" áa'
a1
alias a2='printf "<%s>\\n" aá'
a2
unalias a1 a2
+2
View File
@@ -19,6 +19,7 @@ argv[1] = <sed> argv[2] = <-e> argv[3] = <s/[^I:]//g>
argv[1] = <foo\^Jbar>
argv[1] = <foobar>
argv[1] = <foo\^Jbar>
nested
#esac
a
ok 1
@@ -62,5 +63,6 @@ ok 4
ok 5
ok 6
ok 7
ok 9
ok 8
ok 8
+7
View File
@@ -69,6 +69,13 @@ comsub_foo_1()
echo $(while true; do case $HOME in /*) echo abs ;; esac; done)
}
echo $(
echo $(
echo $(echo $( echo nested )
)
)
)
${THIS_SH} ./comsub1.sub
${THIS_SH} ./comsub2.sub
${THIS_SH} ./comsub3.sub
+6
View File
@@ -36,6 +36,12 @@ echo "$( nest echo ok 7 ) )"
alias short='echo ok 8 )'
alias DO='{ '
alias DONE='}'
got=$(DO
echo ok 9; DONE)
echo "$got"
echo $( short
echo "$( short "
+15 -8
View File
@@ -53,16 +53,23 @@ unset before after
# date +%s should be portable enough now
# then try gawk, perl, python in that order
now1=$(date +%s 2>/dev/null) D=date
[ -z "$now1" ] && now1=$(gawk 'BEGIN { print systime(); }' 2>/dev/null) D=gawk
[ -z "$now1" ] && now1=$(perl -e 'print time' 2>/dev/null) D=perl
[ -z "$now1" ] && now1=$(python -c 'import time; ts = int(time.time()); print(ts)' 2>/dev/null) D=python
[ -z "$now1" ] &&
{
now1=$(gawk 'BEGIN { print systime(); }' 2>/dev/null) D=gawk
[ -z "$now1" ] && now1=$(perl -e 'print time' 2>/dev/null) D=perl
[ -z "$now1" ] && now1=$(python -c 'import time; ts = int(time.time()); print(ts)' 2>/dev/null) D=python
}
now2=$EPOCHSECONDS
case $now1 in
$now2) echo EPOCHSECONDS ok ;;
'') echo "cannot get current time using date/gawk/perl/python" >&2 ;;
*) echo "current time via $D and EPOCHSECONDS possible mismatch|$now1|$now2" >&2 ;;
esac
# use a window of +-1 second
offset=1
if [[ -z $now1 ]]; then
echo "cannot get current time using date/gawk/perl/python" >&2
elif (( $now1 - $offset <= $now2 && $now2 <= $now1 + $offset )); then
echo EPOCHSECONDS ok
else
echo "current time via $D and EPOCHSECONDS possible mismatch|$now1|$now2|offset=$offset" >&2
fi
unset now1 now2 D
LC_ALL=C # force decimal point to `.'
+7 -1
View File
@@ -196,7 +196,13 @@ ok 4
ok 5
./errors8.sub: line 14: set: notanoption: invalid option name
ok 6
DEBUG
./errors9.sub: line 6: [[: ++: syntax error: operand expected (error token is "+")
DEBUG
./errors9.sub: line 8: ((: -- : syntax error: operand expected (error token is "- ")
DEBUG
./errors9.sub: line 10: ((: -- : syntax error: operand expected (error token is "- ")
bash: line 1: return: can only `return' from a function or sourced script
after return
bash: line 1: return: can only `return' from a function or sourced script
./errors.tests: line 304: `!!': not a valid identifier
./errors.tests: line 305: `!!': not a valid identifier
+1
View File
@@ -292,6 +292,7 @@ ${THIS_SH} ./errors7.sub
${THIS_SH} -o posix ./errors7.sub
${THIS_SH} ./errors8.sub
${THIS_SH} ./errors9.sub
${THIS_SH} -c 'return ; echo after return' bash
${THIS_SH} -o posix -c 'return ; echo after return' bash
+14
View File
@@ -0,0 +1,14 @@
trap 'echo DEBUG' DEBUG
# make sure that the right command name appears in the error messages and
# that the DEBUG trap doesn't overwrite it
[[ ++ -gt 3 ]]
(( -- ))
for (( -- ; ++; -- ))
do
echo bogus
done
+2 -1
View File
@@ -120,11 +120,12 @@ argv[3] = <ve>
5: ${x#$pat}
6: ${y#$'not'}
7: ${y#'not'}
./heredoc7.sub: line 17: warning: command substitution: 1 unterminated here-document
foo bar
./heredoc7.sub: line 21: after: command not found
./heredoc7.sub: line 29: warning: here-document at line 29 delimited by end-of-file (wanted `EOF')
./heredoc7.sub: line 29: foobar: command not found
./heredoc7.sub: line 29: EOF: command not found
./heredoc7.sub: line 30: EOF: command not found
grep: *.c: No such file or directory
comsub here-string
./heredoc.tests: line 156: warning: here-document at line 154 delimited by end-of-file (wanted `EOF')
+8
View File
@@ -780,6 +780,14 @@ let\&ee
let\&ee
let&ee
let&ee
twoone
&twoone
onetwo
one&two
two
&two
otwone
&twone
argv[1] = </>
argv[1] = </>
+17
View File
@@ -101,3 +101,20 @@ echo ${var//$pat/"\&"}
echo ${var//$pat/"$r3"}
echo ${var//$pat/"&"}
echo ${var//$pat/$r3}
# these cases provide the same functionality as sed when given a BRE like
# `^' or `$', or when passed a null input line
one=one
null=
echo ${one/#/&two}
echo ${one/#/\&two}
echo ${one/%/&two}
echo ${one/%/\&two}
echo ${null/#/&two}
echo ${null/#/\&two}
echo ${one/#?/&two}
echo ${one/#?/\&two}
+3 -1
View File
@@ -220,6 +220,8 @@ t ! -z "$z"
0
t ! -n "$z"
1
t ! ! "$z"
0
t "$zero"
1
t ! "$zero"
@@ -272,7 +274,7 @@ b ( 1 = 2
2
./test.tests: line 26: test: too many arguments
2
./test.tests: line 431: [: missing `]'
./test.tests: line 434: [: missing `]'
2
./test.tests: line 26: test: (: unary operator expected
2
+3
View File
@@ -358,6 +358,9 @@ t ! -z "$z"
echo 't ! -n "$z"'
t ! -n "$z"
echo 't ! ! "$z"'
t ! ! "$z"
zero=
echo 't "$zero"'
t "$zero"