mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-07 02:32:27 +02:00
bash-4.4 rc1 release
This commit is contained in:
+10
-4
@@ -236,14 +236,20 @@ ok
|
||||
0
|
||||
0, 0
|
||||
0, 1
|
||||
efg
|
||||
e
|
||||
efg
|
||||
e
|
||||
abcdefg
|
||||
efg
|
||||
8 12
|
||||
./arith.tests: line 290: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
|
||||
./arith.tests: line 294: a b: syntax error in expression (error token is "b")
|
||||
./arith.tests: line 295: ((: a b: syntax error in expression (error token is "b")
|
||||
./arith.tests: line 294: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
|
||||
./arith.tests: line 298: a b: syntax error in expression (error token is "b")
|
||||
./arith.tests: line 299: ((: a b: syntax error in expression (error token is "b")
|
||||
42
|
||||
42
|
||||
42
|
||||
42
|
||||
42
|
||||
42
|
||||
./arith.tests: line 306: b[c]d: syntax error in expression (error token is "d")
|
||||
./arith.tests: line 310: b[c]d: syntax error in expression (error token is "d")
|
||||
|
||||
@@ -279,6 +279,10 @@ ${THIS_SH} ./arith5.sub
|
||||
# problems with suppressing evaluation present through bash-4.2
|
||||
${THIS_SH} ./arith6.sub
|
||||
|
||||
# problems with parsing arithmetic expressions containing colons that are
|
||||
# part of word expansions such as substring extraction
|
||||
${THIS_SH} ./arith7.sub
|
||||
|
||||
x=4
|
||||
y=7
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
PARAM=abcdefg
|
||||
|
||||
echo ${PARAM:1 ? 4 : 2}
|
||||
echo ${PARAM:1 ? 4 : 2:1}
|
||||
|
||||
echo ${PARAM: 4<5 ? 4 : 2}
|
||||
echo ${PARAM: 5>4 ? 4 : 2:1}
|
||||
|
||||
echo ${PARAM:${OFFSET:-0}}
|
||||
OFFSET=4
|
||||
echo ${PARAM:${OFFSET:-0}}
|
||||
@@ -0,0 +1,37 @@
|
||||
after f1:declare -ar a=([0]="1")
|
||||
./attr.tests: line 4: a: readonly variable
|
||||
after f2:declare -ar a=([0]="1")
|
||||
./attr.tests: line 5: a: readonly variable
|
||||
after f3:declare -ar a=([0]="1")
|
||||
./attr.tests: line 6: readonly: a: readonly variable
|
||||
after f4:declare -ar a=([0]="1")
|
||||
after f2:declare -ar b=([0]="2")
|
||||
after f3:declare -ar c=([0]="(3)")
|
||||
after f4:declare -ar d=([0]="4")
|
||||
declare -r m="4"
|
||||
in func:declare -r n="4"
|
||||
declare -r n="4"
|
||||
./attr1.sub: line 13: p: readonly variable
|
||||
declare -r p="1"
|
||||
./attr1.sub: line 19: r: readonly variable
|
||||
declare -ar r=([0]="1")
|
||||
./attr1.sub: line 23: r: readonly variable
|
||||
declare -ar r=([0]="1")
|
||||
./attr1.sub: line 27: r: readonly variable
|
||||
declare -ar r=([0]="1")
|
||||
./attr1.sub: line 31: readonly: r: readonly variable
|
||||
declare -ar r=([0]="1")
|
||||
declare -ar x=([0]="4")
|
||||
in func:declare -ar y=([0]="4")
|
||||
declare -ar y=([0]="4")
|
||||
in func:declare -ar z=([0]="4")
|
||||
declare -ar z=([0]="4")
|
||||
in func:declare -ar y1=([0]="4")
|
||||
declare -ar y1=([0]="4")
|
||||
in func:declare -ar z1=([0]="4")
|
||||
declare -ar z1=([0]="4")
|
||||
declare -x p="4"
|
||||
declare -ax r=([0]="4")
|
||||
declare -ax r=([0]="(5)")
|
||||
declare -ax r=([0]="6")
|
||||
declare -ax r=([0]="7")
|
||||
@@ -0,0 +1,41 @@
|
||||
a=(outside)
|
||||
|
||||
f1() { readonly a=(1) ; }
|
||||
f2() { readonly -a a=(2) ; }
|
||||
f3() { readonly 'a=(3)' ; }
|
||||
f4() { readonly -a 'a=(4)' ; }
|
||||
|
||||
f1
|
||||
echo -n after f1:
|
||||
declare -p a
|
||||
f2
|
||||
echo -n after f2:
|
||||
declare -p a
|
||||
f3
|
||||
echo -n after f3:
|
||||
declare -p a
|
||||
f4
|
||||
echo -n after f4:
|
||||
declare -p a
|
||||
|
||||
b=(outside)
|
||||
c=(outside)
|
||||
d=(outside)
|
||||
|
||||
f2() { readonly -a b=(2) ; }
|
||||
f3() { readonly 'c=(3)' ; }
|
||||
f4() { readonly -a 'd=(4)' ; }
|
||||
|
||||
f2
|
||||
echo -n after f2:
|
||||
declare -p b
|
||||
f3
|
||||
echo -n after f3:
|
||||
declare -p c
|
||||
f4
|
||||
echo -n after f4:
|
||||
declare -p d
|
||||
|
||||
${THIS_SH} ./attr1.sub
|
||||
${THIS_SH} ./attr2.sub
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
m=1
|
||||
readonly m=4
|
||||
declare -p m
|
||||
|
||||
n=1
|
||||
f() { readonly n=4; echo -n in func: ; declare -p n ; }
|
||||
f
|
||||
declare -p n
|
||||
|
||||
p=1
|
||||
readonly p
|
||||
|
||||
readonly p=4
|
||||
declare -p p
|
||||
|
||||
r=(1)
|
||||
readonly r
|
||||
|
||||
f() { readonly r=(4) ; }
|
||||
f
|
||||
declare -p r
|
||||
|
||||
f() { readonly r='(5)' ; }
|
||||
f
|
||||
declare -p r
|
||||
|
||||
f() { readonly -a r=(6) ; }
|
||||
f
|
||||
declare -p r
|
||||
|
||||
f() { readonly -a r='(7)' ; }
|
||||
f
|
||||
declare -p r
|
||||
|
||||
x=(1)
|
||||
readonly x=(4)
|
||||
declare -p x
|
||||
|
||||
y=(1)
|
||||
f() { readonly y=(4); echo -n in func: ; declare -p y; }
|
||||
f
|
||||
declare -p y
|
||||
|
||||
z=(1)
|
||||
f() { readonly -a z=(4); echo -n in func: ; declare -p z; }
|
||||
f
|
||||
declare -p z
|
||||
|
||||
f() { readonly y1=(4); echo -n in func: ; declare -p y1; }
|
||||
f
|
||||
declare -p y1
|
||||
|
||||
f() { readonly -a z1=(4); echo -n in func: ; declare -p z1; }
|
||||
f
|
||||
declare -p z1
|
||||
@@ -0,0 +1,24 @@
|
||||
p=1
|
||||
export p
|
||||
|
||||
export p=4
|
||||
declare -p p
|
||||
|
||||
r=(1)
|
||||
export r
|
||||
|
||||
f() { export r=(4) ; }
|
||||
f
|
||||
declare -p r
|
||||
|
||||
f() { export r='(5)' ; }
|
||||
f
|
||||
declare -p r
|
||||
|
||||
f() { export -a r=(6) ; }
|
||||
f
|
||||
declare -p r
|
||||
|
||||
f() { export -a r='(7)' ; }
|
||||
f
|
||||
declare -p r
|
||||
@@ -41,6 +41,11 @@ found 2
|
||||
libc
|
||||
ok 42
|
||||
ok 43
|
||||
ok 1
|
||||
ok 2
|
||||
ok 3
|
||||
ok 4
|
||||
ok 5
|
||||
match 1
|
||||
match 2
|
||||
match 3
|
||||
|
||||
@@ -180,6 +180,17 @@ echo ${BASH_REMATCH[@]}
|
||||
if [[ "123abc" == *?(a)bc ]]; then echo ok 42; else echo bad 42; fi
|
||||
if [[ "123abc" == *?(a)bc ]]; then echo ok 43; else echo bad 43; fi
|
||||
|
||||
foo=""
|
||||
[[ bar == *"${foo,,}"* ]] && echo ok 1
|
||||
[[ bar == *${foo,,}* ]] && echo ok 2
|
||||
|
||||
shopt -s extquote
|
||||
bs='\'
|
||||
del=$'\177'
|
||||
[[ bar == *$bs"$del"* ]] || echo ok 3
|
||||
[[ "" == "$foo" ]] && echo ok 4
|
||||
[[ "$del" == "${foo,,}" ]] || echo ok 5
|
||||
|
||||
${THIS_SH} ./cond-regexp1.sub
|
||||
|
||||
${THIS_SH} ./cond-regexp2.sub
|
||||
|
||||
@@ -218,6 +218,7 @@ ${THIS_SH} ./dollar-at-star3.sub
|
||||
${THIS_SH} ./dollar-at-star4.sub
|
||||
${THIS_SH} ./dollar-at-star5.sub
|
||||
${THIS_SH} ./dollar-at-star6.sub
|
||||
${THIS_SH} ./dollar-at-star7.sub
|
||||
|
||||
# tests for special expansion of "$*" and "${array[*]}" when used with other
|
||||
# expansions -- bugs through bash-2.05b
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
IFS='' # testing with only empty IFS
|
||||
|
||||
set -- this is a test
|
||||
|
||||
printf '|%s|\n' ${1+"$@"}
|
||||
echo
|
||||
printf '|%s|\n' "${1+$@}"
|
||||
echo
|
||||
printf '|%s|\n' "$@"
|
||||
echo
|
||||
|
||||
printf '|%s|\n' ${1-"$@"}
|
||||
printf '|%s|\n' "${1-$@}"
|
||||
|
||||
echo
|
||||
: ${foo:="$@"}
|
||||
printf '|%s|\n' "$foo"
|
||||
|
||||
unset foo
|
||||
: "${foo:=$@}"
|
||||
printf '|%s|\n' "$foo"
|
||||
|
||||
unset foo
|
||||
printf '|%s|\n' ${foo-"$@"}
|
||||
printf '|%s|\n' "${foo-$@}"
|
||||
@@ -266,6 +266,34 @@ argv[3] = <'c'>
|
||||
argv[1] = <'a'>
|
||||
argv[2] = <'b'>
|
||||
argv[3] = <'c'>
|
||||
|this|
|
||||
|is|
|
||||
|a|
|
||||
|test|
|
||||
|
||||
|this|
|
||||
|is|
|
||||
|a|
|
||||
|test|
|
||||
|
||||
|this|
|
||||
|is|
|
||||
|a|
|
||||
|test|
|
||||
|
||||
|this|
|
||||
|this|
|
||||
|
||||
|this is a test|
|
||||
|this is a test|
|
||||
|this|
|
||||
|is|
|
||||
|a|
|
||||
|test|
|
||||
|this|
|
||||
|is|
|
||||
|a|
|
||||
|test|
|
||||
xa|xb|xc
|
||||
xa|xb|xc
|
||||
a|b|c
|
||||
|
||||
@@ -97,3 +97,11 @@ d
|
||||
c
|
||||
d
|
||||
e
|
||||
x1
|
||||
x1a
|
||||
x2
|
||||
x2a
|
||||
x2b
|
||||
x3
|
||||
x3a
|
||||
x3b
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
echo x1 | ( cat & wait )
|
||||
echo x1a | ( :& cat & wait )
|
||||
|
||||
echo x2 | for f in 1; do
|
||||
cat & wait
|
||||
done
|
||||
echo x2a | if true; then cat & wait; fi
|
||||
echo x2b | for (( i=0; i < 1; i++ )) ; do cat & wait; done
|
||||
|
||||
echo x3 | { cat & wait; }
|
||||
|
||||
lambda() { cat & wait; }
|
||||
echo x3a | lambda
|
||||
|
||||
: ${TMPDIR:=/tmp}
|
||||
SRCF=$TMPDIR/bash-src-$$
|
||||
cat > $SRCF << \EOF
|
||||
cat & wait
|
||||
EOF
|
||||
echo x3b | . $SRCF
|
||||
rm -f $SRCF
|
||||
@@ -155,3 +155,5 @@ $THIS_SH -c 'echo A && /bin/echo B'
|
||||
|
||||
$THIS_SH -c '/bin/echo c && echo d'
|
||||
$THIS_SH -c '/bin/echo c && /bin/echo d && echo e'
|
||||
|
||||
${THIS_SH} ./exec13.sub
|
||||
|
||||
@@ -143,3 +143,49 @@ echo a b c d 2 > /dev/null
|
||||
\!
|
||||
\!
|
||||
\!
|
||||
a
|
||||
b
|
||||
c
|
||||
echo "#!/bin/bash" set -o posix
|
||||
#!/bin/bash set -o posix
|
||||
!!
|
||||
!!
|
||||
a
|
||||
echo $(echo echo a)
|
||||
echo a
|
||||
a
|
||||
echo echo a $(echo echo a)
|
||||
echo a echo a
|
||||
b
|
||||
!! $(echo !!)
|
||||
c
|
||||
echo "echo c" "$(echo echo c)"
|
||||
echo c echo c
|
||||
d
|
||||
echo "echo d" $(echo "echo d")
|
||||
echo d echo d
|
||||
e
|
||||
!! !!
|
||||
f
|
||||
!!
|
||||
f
|
||||
!!
|
||||
g
|
||||
echo "echo g"
|
||||
echo g
|
||||
g
|
||||
eval echo "echo g"
|
||||
echo g
|
||||
a
|
||||
cat < <(echo echo a)
|
||||
echo a
|
||||
b
|
||||
echo echo b `echo echo b`
|
||||
echo b echo b
|
||||
c
|
||||
!
|
||||
d
|
||||
!
|
||||
e
|
||||
! !
|
||||
./histexp4.sub: line 20: !': event not found
|
||||
|
||||
@@ -129,3 +129,6 @@ echo !shopt-1
|
||||
echo !shopt*
|
||||
|
||||
${THIS_SH} ./histexp1.sub
|
||||
${THIS_SH} ./histexp2.sub
|
||||
${THIS_SH} ./histexp3.sub
|
||||
${THIS_SH} ./histexp4.sub
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
LANG=C LC_ALL=C
|
||||
|
||||
set -o history
|
||||
echo a
|
||||
echo b
|
||||
echo c
|
||||
|
||||
set -o histexpand
|
||||
set -o posix
|
||||
|
||||
echo "#!/bin/bash" !!
|
||||
|
||||
echo '!!'
|
||||
echo "!!"
|
||||
@@ -0,0 +1,35 @@
|
||||
HISTFILE=${TMPDIR}/bashhist-$$
|
||||
|
||||
set -o history
|
||||
set -o histexpand
|
||||
|
||||
echo a
|
||||
echo $(echo !!)
|
||||
|
||||
echo a
|
||||
echo !! $(echo !!)
|
||||
|
||||
echo b
|
||||
echo '!!' '$(echo !!)'
|
||||
|
||||
echo c
|
||||
echo "!!" "$(echo !!)"
|
||||
|
||||
echo d
|
||||
echo "!!" $(echo "!!")
|
||||
|
||||
echo e
|
||||
echo '!!' $(echo '!!')
|
||||
|
||||
echo f
|
||||
echo '!!'
|
||||
echo f
|
||||
eval echo '!!'
|
||||
|
||||
echo g
|
||||
echo "!!"
|
||||
echo g
|
||||
eval echo "!!"
|
||||
|
||||
set +o history
|
||||
rm -f $HISTFILE # just in case
|
||||
@@ -0,0 +1,23 @@
|
||||
HISTFILE=$TMPDIR/bashhist-$$
|
||||
|
||||
set -o history
|
||||
set -o histexpand
|
||||
|
||||
echo a
|
||||
cat < <(echo !!)
|
||||
|
||||
echo b
|
||||
echo !! `echo !!`
|
||||
|
||||
echo c
|
||||
echo "$(echo "!" )"
|
||||
|
||||
echo d
|
||||
echo "$(echo '!' )"
|
||||
|
||||
echo e
|
||||
echo '!' "!"
|
||||
echo "'!'"
|
||||
|
||||
set +o history
|
||||
rm -f $HISTFILE
|
||||
+1
-1
@@ -61,7 +61,7 @@ fg: usage: fg [job_spec]
|
||||
./jobs.tests: line 99: bg: -s: invalid option
|
||||
bg: usage: bg [job_spec ...]
|
||||
./jobs.tests: line 104: disown: -s: invalid option
|
||||
disown: usage: disown [-h] [-ar] [jobspec ...]
|
||||
disown: usage: disown [-h] [-ar] [jobspec ... | pid ...]
|
||||
./jobs.tests: line 108: disown: %1: no such job
|
||||
./jobs.tests: line 111: disown: %2: no such job
|
||||
wait-for-non-child
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
recho $'\c?'
|
||||
|
||||
echo $'\c?' | od -a | _intl_normalize_spaces
|
||||
echo $'\c[\c\\\c]\c^\c_\c?' | od -a | _intl_normalize_spaces
|
||||
echo $'\c?' | od -t a | _intl_normalize_spaces
|
||||
echo $'\c[\c\\\c]\c^\c_\c?' | od -t a | _intl_normalize_spaces
|
||||
|
||||
echo $'\q'
|
||||
|
||||
+5
-2
@@ -3,7 +3,10 @@
|
||||
: ${TMPDIR:=/tmp}
|
||||
export TMPDIR
|
||||
|
||||
BASH_TSTOUT=/tmp/xx # for now
|
||||
# basic /bin/sh syntax
|
||||
SUFFIX=`${THIS_SH} -c 'echo $(( $RANDOM + $BASHPID ))'`
|
||||
|
||||
BASH_TSTOUT=${TMPDIR}/bashtst-$SUFFIX # for now
|
||||
export BASH_TSTOUT
|
||||
|
||||
trap 'rm -f $BASH_TSTOUT' 0
|
||||
@@ -30,7 +33,7 @@ do
|
||||
case $x in
|
||||
$0|run-minimal|run-gprof) ;;
|
||||
*.orig|*~) ;;
|
||||
*) echo $x ; sh $x ;;
|
||||
*) echo $x ; sh $x ; rm -f ${BASH_TSTOUT} ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
${THIS_SH} ./attr.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
|
||||
diff ${BASH_TSTOUT} attr.right && rm -f ${BASH_TSTOUT}
|
||||
@@ -1,2 +1,3 @@
|
||||
unset OLDPWD # make sure shell doesn't inherit OLDPWD
|
||||
${THIS_SH} ./errors.tests > ${BASH_TSTOUT} 2>&1
|
||||
diff ${BASH_TSTOUT} errors.right && rm -f ${BASH_TSTOUT}
|
||||
|
||||
+5
-1
@@ -7,7 +7,10 @@
|
||||
: ${TMPDIR:=/tmp}
|
||||
export TMPDIR
|
||||
|
||||
BASH_TSTOUT=/tmp/xx # for now
|
||||
# basic /bin/sh syntax
|
||||
SUFFIX=`${THIS_SH} -c 'echo $(( $RANDOM + $BASHPID ))'`
|
||||
|
||||
BASH_TSTOUT=${TMPDIR}/bashtst-$SUFFIX # for now
|
||||
export BASH_TSTOUT
|
||||
|
||||
trap 'rm -f $BASH_TSTOUT' 0
|
||||
@@ -40,6 +43,7 @@ do
|
||||
run-precedence|run-quote|run-read|run-rhs-exp|run-strip|run-tilde) echo $x ; sh $x ;;
|
||||
*) ;;
|
||||
esac
|
||||
rm -f "$BASH_TSTOUT"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -33,6 +33,7 @@ shopt -u histreedit
|
||||
shopt -u histverify
|
||||
shopt -s hostcomplete
|
||||
shopt -u huponexit
|
||||
shopt -u inherit_errexit
|
||||
shopt -s interactive_comments
|
||||
shopt -u lastpipe
|
||||
shopt -u lithist
|
||||
@@ -90,6 +91,7 @@ shopt -u histappend
|
||||
shopt -u histreedit
|
||||
shopt -u histverify
|
||||
shopt -u huponexit
|
||||
shopt -u inherit_errexit
|
||||
shopt -u lastpipe
|
||||
shopt -u lithist
|
||||
shopt -u login_shell
|
||||
@@ -127,6 +129,7 @@ histappend off
|
||||
histreedit off
|
||||
histverify off
|
||||
huponexit off
|
||||
inherit_errexit off
|
||||
lastpipe off
|
||||
lithist off
|
||||
login_shell off
|
||||
|
||||
@@ -83,6 +83,14 @@ outside: outside
|
||||
local: unset1 unset2
|
||||
abc
|
||||
abc
|
||||
:1
|
||||
:2
|
||||
after: ----
|
||||
global:1
|
||||
global:2
|
||||
after: --global--
|
||||
after: ----
|
||||
x = :1:2
|
||||
a=z
|
||||
a=b
|
||||
a=z
|
||||
|
||||
@@ -217,5 +217,9 @@ ${THIS_SH} ./varenv6.sub
|
||||
# variable declaration problems with arrays and readonly local variables
|
||||
${THIS_SH} ./varenv7.sub
|
||||
|
||||
# variable visibility problems with process substitution subshells in
|
||||
# redirections
|
||||
${THIS_SH} ./varenv8.sub
|
||||
|
||||
# make sure variable scoping is done right
|
||||
tt() { typeset a=b;echo a=$a; };a=z;echo a=$a;tt;echo a=$a
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
FOO=bar cat < <(echo $FOO:1; echo $FOO:2)
|
||||
echo after: --${FOO}--
|
||||
|
||||
unset FOO
|
||||
FOO=global
|
||||
|
||||
FOO=bar cat < <(echo $FOO:1; echo $FOO:2)
|
||||
echo after: --${FOO}--
|
||||
|
||||
unset FOO
|
||||
FOO=bar read x < <(echo -n $FOO:1; echo $FOO:2)
|
||||
echo after: --${FOO}--
|
||||
echo x = $x
|
||||
|
||||
Reference in New Issue
Block a user