mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-10 20:20:38 +02:00
Bash-5.2-rc2 release
This commit is contained in:
@@ -41,3 +41,5 @@ baz
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
<áa>
|
||||
<aá>
|
||||
|
||||
@@ -62,3 +62,4 @@ ${THIS_SH} ./alias2.sub
|
||||
${THIS_SH} ./alias3.sub
|
||||
${THIS_SH} ./alias4.sub
|
||||
${THIS_SH} ./alias5.sub
|
||||
${THIS_SH} ./alias6.sub
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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')
|
||||
|
||||
@@ -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] = </>
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user