commit bash-20101025 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 22:09:11 -05:00
parent bf19c529dd
commit e05be32def
90 changed files with 29015 additions and 6199 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/chet/bash/bash-current
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+5 -4
View File
@@ -200,14 +200,15 @@ ok
4
10000
10000
2147483649
8 12
./arith.tests: line 275: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
./arith.tests: line 279: a b: syntax error in expression (error token is "b")
./arith.tests: line 280: ((: a b: syntax error in expression (error token is "b")
./arith.tests: line 278: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
./arith.tests: line 282: a b: syntax error in expression (error token is "b")
./arith.tests: line 283: ((: a b: syntax error in expression (error token is "b")
42
42
42
42
42
42
./arith.tests: line 291: b[c]d: syntax error in expression (error token is "d")
./arith.tests: line 294: b[c]d: syntax error in expression (error token is "d")
+3
View File
@@ -264,6 +264,9 @@ ${THIS_SH} ./arith1.sub
${THIS_SH} ./arith2.sub
${THIS_SH} ./arith3.sub
# make sure arithmetic expansion handles ints > 2**31 - 1 using intmax_t
echo $(( 2147483645 + 4 ))
x=4
y=7
+291
View File
@@ -0,0 +1,291 @@
set +o posix
declare -i iv jv
iv=$(( 3 + 5 * 32 ))
echo $iv
iv=iv+3
echo $iv
iv=2
jv=iv
let "jv *= 2"
echo $jv
jv=$(( $jv << 2 ))
echo $jv
let jv="$jv / 2"
echo $jv
jv="jv >> 2"
echo $jv
iv=$((iv+ $jv))
echo $iv
echo $((iv -= jv))
echo $iv
echo $(( iv == jv ))
echo $(( iv != $jv ))
echo $(( iv < jv ))
echo $(( $iv > $jv ))
echo $(( iv <= $jv ))
echo $(( $iv >= jv ))
echo $jv
echo $(( ~$jv ))
echo $(( ~1 ))
echo $(( ! 0 ))
echo $(( jv % 2 ))
echo $(( $iv % 4 ))
echo $(( iv <<= 16 ))
echo $(( iv %= 33 ))
echo $(( 33 & 55 ))
echo $(( 33 | 17 ))
echo $(( iv && $jv ))
echo $(( $iv || jv ))
echo $(( iv && 0 ))
echo $(( iv & 0 ))
echo $(( iv && 1 ))
echo $(( iv & 1 ))
echo $(( $jv || 0 ))
echo $(( jv | 0 ))
echo $(( jv | 1 ))
echo $(( $jv || 1 ))
let 'iv *= jv'
echo $iv
echo $jv
let "jv += $iv"
echo $jv
echo $(( jv /= iv ))
echo $(( jv <<= 8 ))
echo $(( jv >>= 4 ))
echo $(( iv |= 4 ))
echo $(( iv &= 4 ))
echo $(( iv += (jv + 9)))
echo $(( (iv + 4) % 7 ))
# unary plus, minus
echo $(( +4 - 8 ))
echo $(( -4 + 8 ))
# conditional expressions
echo $(( 4<5 ? 1 : 32))
echo $(( 4>5 ? 1 : 32))
echo $(( 4>(2+3) ? 1 : 32))
echo $(( 4<(2+3) ? 1 : 32))
echo $(( (2+2)<(2+3) ? 1 : 32))
echo $(( (2+2)>(2+3) ? 1 : 32))
# bug in bash versions through bash-3.2
S=105
W=$((S>99?4:S>9?3:S>0?2:0))
echo $W
unset W S
# check that the unevaluated part of the ternary operator does not do
# evaluation or assignment
x=i+=2
y=j+=2
declare -i i=1 j=1
echo $((1 ? 20 : (x+=2)))
echo $i,$x
echo $((0 ? (y+=2) : 30))
echo $j,$y
x=i+=2
y=j+=2
declare -i i=1 j=1
echo $((1 ? 20 : (x+=2)))
echo $i,$x
echo $((0 ? (y+=2) : 30))
echo $i,$y
# check precedence of assignment vs. conditional operator
# should be an error
declare -i x=2
y=$((1 ? 20 : x+=2))
# check precedence of assignment vs. conditional operator
declare -i x=2
echo $((0 ? x+=2 : 20))
# associativity of assignment-operator operator
declare -i i=1 j=2 k=3
echo $((i += j += k))
echo $i,$j,$k
# octal, hex
echo $(( 0x100 | 007 ))
echo $(( 0xff ))
echo $(( 16#ff ))
echo $(( 16#FF/2 ))
echo $(( 8#44 ))
echo $(( 8 ^ 32 ))
# other bases
echo $(( 16#a ))
echo $(( 32#a ))
echo $(( 56#a ))
echo $(( 64#a ))
echo $(( 16#A ))
echo $(( 32#A ))
echo $(( 56#A ))
echo $(( 64#A ))
echo $(( 64#@ ))
echo $(( 64#_ ))
# weird bases
echo $(( 3425#56 ))
# missing number after base
echo $(( 2# ))
# these should generate errors
echo $(( 7 = 43 ))
echo $(( 2#44 ))
echo $(( 44 / 0 ))
let 'jv += $iv'
echo $(( jv += \$iv ))
let 'rv = 7 + (43 * 6'
# more errors
declare -i i
i=0#4
i=2#110#11
((echo abc; echo def;); echo ghi)
if (((4+4) + (4 + 7))); then
echo ok
fi
(()) # make sure the null expression works OK
a=(0 2 4 6)
echo $(( a[1] + a[2] ))
echo $(( (a[1] + a[2]) == a[3] ))
(( (a[1] + a[2]) == a[3] )) ; echo $?
# test pushing and popping the expression stack
unset A
A="4 + "
echo $(( ( 4 + A ) + 4 ))
A="3 + 5"
echo $(( ( 4 + A ) + 4 ))
# badly-formed conditional expressions
echo $(( 4 ? : $A ))
echo $(( 1 ? 20 ))
echo $(( 4 ? 20 : ))
# precedence and short-circuit evaluation
B=9
echo $B
echo $(( 0 && B=42 ))
echo $B
echo $(( 1 || B=88 ))
echo $B
echo $(( 0 && (B=42) ))
echo $B
echo $(( (${$} - $$) && (B=42) ))
echo $B
echo $(( 1 || (B=88) ))
echo $B
# until command with (( )) command
x=7
echo $x
until (( x == 4 ))
do
echo $x
x=4
done
echo $x
# exponentiation
echo $(( 2**15 - 1))
echo $(( 2**(16-1)))
echo $(( 2**16*2 ))
echo $(( 2**31-1))
echo $(( 2**0 ))
# {pre,post}-{inc,dec}rement and associated errors
x=4
echo $x
echo $(( x++ ))
echo $x
echo $(( x-- ))
echo $x
echo $(( --x ))
echo $x
echo $(( ++x ))
echo $x
echo $(( ++7 ))
echo $(( 7-- ))
echo $(( --x=7 ))
echo $(( ++x=7 ))
echo $(( x++=7 ))
echo $(( x--=7 ))
echo $x
echo $(( +7 ))
echo $(( -7 ))
echo $(( ++7 ))
echo $(( --7 ))
${THIS_SH} ./arith1.sub
${THIS_SH} ./arith2.sub
${THIS_SH} ./arith3.sub
x=4
y=7
(( x=8 , y=12 ))
echo $x $y
# should be an error
(( x=9 y=41 ))
# These are errors
unset b
echo $((a b))
((a b))
n=42
printf "%d\n" $n
printf "%i\n" $n
echo $(( 8#$(printf "%o\n" $n) ))
printf "%u\n" $n
echo $(( 16#$(printf "%x\n" $n) ))
echo $(( 16#$(printf "%X\n" $n) ))
# causes longjmp botches through bash-2.05b
a[b[c]d]=e
+1
View File
@@ -57,6 +57,7 @@ a-{bdef-g-c a-{bdef-i-c
a b c d e f g h i j k l m n o p q r s t u v w x y z
a c e g i k m o q s u w y
z x v t r p n l j h f d b
2147483645 2147483646 2147483647 2147483648 2147483649
10 8 6 4 2 0
10 8 6 4 2 0
-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0
+3
View File
@@ -94,6 +94,9 @@ echo {a..z}
echo {a..z..2}
echo {z..a..-2}
# make sure brace expansion handles ints > 2**31 - 1 using intmax_t
echo {2147483645..2147483649}
# unwanted zero-padding -- fixed post-bash-4.0
echo {10..0..2}
echo {10..0..-2}
+119
View File
@@ -0,0 +1,119 @@
echo ff{c,b,a}
echo f{d,e,f}g
echo {l,n,m}xyz
echo {abc\,def}
echo {abc}
echo \{a,b,c,d,e}
echo {x,y,\{a,b,c}}
echo {x\,y,\{abc\},trie}
echo /usr/{ucb/{ex,edit},lib/{ex,how_ex}}
echo XXXX\{`echo a b c | tr ' ' ','`\}
eval echo XXXX\{`echo a b c | tr ' ' ','`\}
echo {}
echo { }
echo }
echo {
echo abcd{efgh
echo foo {1,2} bar
echo `zecho foo {1,2} bar`
echo $(zecho foo {1,2} bar)
var=baz
varx=vx
vary=vy
echo foo{bar,${var}.}
echo foo{bar,${var}}
echo "${var}"{x,y}
echo $var{x,y}
echo ${var}{x,y}
unset var varx vary
# new sequence brace operators
echo {1..10}
# this doesn't work yet
echo {0..10,braces}
# but this does
echo {{0..10},braces}
echo x{{0..10},braces}y
echo {3..3}
echo x{3..3}y
echo {10..1}
echo {10..1}y
echo x{10..1}y
echo {a..f}
echo {f..a}
echo {a..A}
echo {A..a}
echo {f..f}
# mixes are incorrectly-formed brace expansions
echo {1..f}
echo {f..1}
echo 0{1..9} {10..20}
# do negative numbers work?
echo {-1..-10}
echo {-20..0}
# weirdly-formed brace expansions -- fixed in post-bash-3.1
echo a-{b{d,e}}-c
echo a-{bdef-{g,i}-c
echo {"klklkl"}{1,2,3}
echo {"x,x"}
echo {1..10..2}
echo {-1..-10..2}
echo {-1..-10..-2}
echo {10..1..-2}
echo {10..1..2}
echo {1..20..2}
echo {1..20..20}
echo {100..0..5}
echo {100..0..-5}
echo {a..z}
echo {a..z..2}
echo {z..a..-2}
# make sure brace expansion handles ints > 2**31 - 1 using intmax_t
echo {2147483645..2147483649}
# unwanted zero-padding -- fixed post-bash-4.0
echo {10..0..2}
echo {10..0..-2}
echo {-50..-0..5}
# bad
echo {1..10.f}
echo {1..ff}
echo {1..10..ff}
echo {1.20..2}
echo {1..20..f2}
echo {1..20..2f}
echo {1..2f..2}
echo {1..ff..2}
echo {1..ff}
echo {1..f}
echo {1..0f}
echo {1..10f}
echo {1..10.f}
echo {1..10.f}
+1
View File
@@ -70,3 +70,4 @@ swap32_posix ()
));
done
}
yes
+8
View File
@@ -205,6 +205,14 @@ ${THIS_SH} ./comsub-posix3.sub
# produced a parse error through bash-4.0-beta2
: $(echo foo)"
"
# produced a parse error through bash-4.1
unset x
x=$(
echo yes
# a comment with " ' \
)
echo $x
unset x
# fixed after bash-4.0 released
: $(case a in a) echo ;; # comment
+2
View File
@@ -200,6 +200,8 @@ ${THIS_SH} ./comsub-posix1.sub
${THIS_SH} ./comsub-posix2.sub
${THIS_SH} ./comsub-posix3.sub
# produced a parse error through bash-4.0-beta2
: $(echo foo)"
"
+7
View File
@@ -115,3 +115,10 @@ echo after
# Problem with bash at least back to version 3.0
${THIS_SH} -c 'VAR=0; VAR=1 command exec; exit ${VAR}'
# problem with bash through bash-4.1
(
exec /var/empty/nosuch
echo bad
) 2>/dev/null
[ $? = 127 ] || echo FAIL: bad exit status $? at $LINENO
+8
View File
@@ -113,4 +113,12 @@ true | `echo true` &
echo after
# Problem with bash at least back to version 3.0
${THIS_SH} -c 'VAR=0; VAR=1 command exec; exit ${VAR}'
# problem with bash through bash-4.1
(
exec /var/empty/nosuch
echo bad
) 2>/dev/null
[ $? = 127 ] || echo exit status = $? at $LINENO
+2 -2
View File
@@ -37,5 +37,5 @@ argv[1] = <'bar>
argv[1] = <foo 'bar baz>
argv[1] = <}z>
argv[1] = <''z}>
./posixexp.tests: line 68: unexpected EOF while looking for matching `}'
./posixexp.tests: line 69: syntax error: unexpected end of file
./posixexp.tests: line 77: unexpected EOF while looking for matching `}'
./posixexp.tests: line 78: syntax error: unexpected end of file
+9
View File
@@ -63,6 +63,15 @@ recho "foo ${IFS+'bar} baz"
recho ${IFS+'}'z}
recho "${IFS+'}'z}"
: ${TMPDIR:=/var/tmp}
rm -f $TMPDIR/sh
cp ${THIS_SH} $TMPDIR/sh
THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp1.sub || echo "sh posixexp1.sub: test $? failed"
${THIS_SH} ./posixexp1.sub || echo "bash posixexp1.sub: test $? failed"
THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp2.sub || echo "sh posixexp2.sub: test $? failed"
rm -f $TMPDIR/sh
# this will be an error
foo=bar
echo "${foo:-"a}"
+20
View File
@@ -1,3 +1,15 @@
unset a
printf "%s\n" ${a:=a\ b}
echo "$a"
unset v
recho ${v=a\ b} x ${v=c\ d}
unset v
recho "${v=a\ b}" x "${v=c\ d}"
unset a v
recho "foo ${IFS+'bar'} baz"
recho "a ${IFS+b c} d"
@@ -51,6 +63,14 @@ recho "foo ${IFS+'bar} baz"
recho ${IFS+'}'z}
recho "${IFS+'}'z}"
: ${TMPDIR:=/var/tmp}
rm -f $TMPDIR/sh
cp ${THIS_SH} $TMPDIR/sh
THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp1.sub || echo "sh posixexp1.sub: test $? failed"
${THIS_SH} ./posixexp1.sub || echo "bash posixexp1.sub: test $? failed"
rm -f $TMPDIR/sh
# this will be an error
foo=bar
echo "${foo:-"a}"
+30
View File
@@ -0,0 +1,30 @@
# $FreeBSD: src/tools/regression/bin/sh/expansion/set-u1.0,v 1.2 2010/10/12 18:20:38 obrien Exp $
${THIS_SH} -uc 'unset foo; echo ${foo}' 2>/dev/null && exit 1
${THIS_SH} -uc 'unset foo; echo $foo' 2>/dev/null && exit 1
${THIS_SH} -uc 'foo=; echo $foo' >/dev/null || exit 2
${THIS_SH} -uc 'foo=1; echo $foo' >/dev/null || exit 3
# -/+/= are unaffected by set -u
${THIS_SH} -uc 'unset foo; echo ${foo-}' >/dev/null || exit 4
${THIS_SH} -uc 'unset foo; echo ${foo+}' >/dev/null || exit 5
${THIS_SH} -uc 'unset foo; echo ${foo=}' >/dev/null || exit 6
# length/trimming are affected
${THIS_SH} -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 7
${THIS_SH} -uc 'foo=; echo ${#foo}' >/dev/null || exit 8
${THIS_SH} -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 9
${THIS_SH} -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 10
${THIS_SH} -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 11
${THIS_SH} -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 12
${THIS_SH} -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 13
${THIS_SH} -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 14
${THIS_SH} -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 15
${THIS_SH} -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 16
${THIS_SH} -uc 'echo $!' 2>/dev/null && exit 17
${THIS_SH} -uc ':& echo $!' >/dev/null || exit 18
${THIS_SH} -uc 'echo $#' >/dev/null || exit 19
${THIS_SH} -uc 'echo $1' 2>/dev/null && exit 20
${THIS_SH} -uc 'echo $1' ${THIS_SH} xnotthere >/dev/null || exit 21
${THIS_SH} -uc 'echo $2' ${THIS_SH} xnotthere 2>/dev/null && exit 22
${THIS_SH} -uc 'echo $2' ${THIS_SH} xnotthere ynotthere >/dev/null || exit 23
exit 0
+30
View File
@@ -0,0 +1,30 @@
# $FreeBSD: src/tools/regression/bin/sh/expansion/set-u1.0,v 1.2 2010/10/12 18:20:38 obrien Exp $
${THIS_SH} -uc 'unset foo; echo ${foo}' 2>/dev/null && exit 1
${THIS_SH} -uc 'unset foo; echo $foo' 2>/dev/null && exit 1
${THIS_SH} -uc 'foo=; echo $foo' >/dev/null || exit 2
${THIS_SH} -uc 'foo=1; echo $foo' >/dev/null || exit 3
# -/+/= are unaffected by set -u
${THIS_SH} -uc 'unset foo; echo ${foo-}' >/dev/null || exit 4
${THIS_SH} -uc 'unset foo; echo ${foo+}' >/dev/null || exit 5
${THIS_SH} -uc 'unset foo; echo ${foo=}' >/dev/null || exit 6
# length/trimming are affected
${THIS_SH} -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 7
${THIS_SH} -uc 'foo=; echo ${#foo}' >/dev/null || exit 8
${THIS_SH} -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 9
${THIS_SH} -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 10
${THIS_SH} -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 11
${THIS_SH} -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 12
${THIS_SH} -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 13
${THIS_SH} -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 14
${THIS_SH} -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 15
${THIS_SH} -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 16
${THIS_SH} -uc 'echo $!' 2>/dev/null && exit 17
${THIS_SH} -uc ':& echo $!' >/dev/null || exit 18
${THIS_SH} -uc 'echo $#' >/dev/null || exit 19
${THIS_SH} -uc 'echo $1' 2>/dev/null && exit 20
${THIS_SH} -uc 'echo $1' ${THIS_SH} x >/dev/null || exit 21
${THIS_SH} -uc 'echo $2' ${THIS_SH} x 2>/dev/null && exit 22
${THIS_SH} -uc 'echo $2' ${THIS_SH} x y >/dev/null || exit 23
exit 0
+40
View File
@@ -0,0 +1,40 @@
1 }z
2 ''z}
3 foo 'bar baz
4 foo b c baz
5 foo b c baz
6 }z
7 }z
8 ""z}
9 "}"z
10 foo bar} baz
11 ''z}
12 }z
13 }z
14 }z
15 <foo abx{ {{{}b c d{} bar> <}> <baz> .
16 hi there
17 hi there
18 hi there
19 hi there
20 hi there
21 hi there
22 hi there
23 hi there
24 'value'
25 'value'
26 $key
27 'value'
28 'x ~ x''x}"x}" #
29 <foo> <abx{ {{> <{}b> <c> <d{}> <bar> <}> <baz> .
30 <foo> <b\
ar> <baz> .
32 <foo> <bar> <baz> .
33 <foo 'bar' baz> .
34 <foo bar baz> .
35 <a> <b> <x> <a> <b> .
36 <a\ b> <x> <a\ b> .
37 <a b> <x> <c d> .
38 xay / x'a'y .
39 x' / x' .
40 < b c> .
+21
View File
@@ -0,0 +1,21 @@
x=a\ b
[ "$x" = "${x?}" ] || exit 1
set -- ${x?}
{ [ "$#" = 2 ] && [ "$1" = a ] && [ "$2" = b ]; } || exit 1
unset x
(echo ${x?abcdefg}) 2>&1 | grep -q abcdefg || exit 1
${THIS_SH} -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 2
${THIS_SH} -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 3
${THIS_SH} -c 'foo=; echo ${foo?}' >/dev/null || exit 4
${THIS_SH} -c 'foo=1; echo ${foo:?}' >/dev/null || exit 5
${THIS_SH} -c 'echo ${!?}' 2>/dev/null && exit 6
${THIS_SH} -c ':& echo ${!?}' >/dev/null || exit 7
${THIS_SH} -c 'echo ${#?}' >/dev/null || exit 8
${THIS_SH} -c 'echo ${*?}' 2>/dev/null && exit 9
${THIS_SH} -c 'echo ${*?}' ${THIS_SH} x >/dev/null || exit 10
${THIS_SH} -c 'echo ${1?}' 2>/dev/null && exit 11
${THIS_SH} -c 'echo ${1?}' ${THIS_SH} x >/dev/null || exit 12
${THIS_SH} -c 'echo ${2?}' ${THIS_SH} x 2>/dev/null && exit 13
${THIS_SH} -c 'echo ${2?}' ${THIS_SH} x y >/dev/null || exit 14
exit 0
+47
View File
@@ -0,0 +1,47 @@
# From mksh
set -o posix
(echo 1 ${IFS+'}'z}) 2>&- || echo failed in 1
(echo 2 "${IFS+'}'z}") 2>&- || echo failed in 2
(echo 3 "foo ${IFS+'bar} baz") 2>&- || echo failed in 3
(echo -n '4 '; printf '%s\n' "foo ${IFS+"b c"} baz") 2>&- || echo failed in 4
(echo -n '5 '; printf '%s\n' "foo ${IFS+b c} baz") 2>&- || echo failed in 5
(echo 6 ${IFS+"}"z}) 2>&- || echo failed in 6
(echo 7 "${IFS+"}"z}") 2>&- || echo failed in 7
(echo 8 "${IFS+\"}\"z}") 2>&- || echo failed in 8
(echo 9 "${IFS+\"\}\"z}") 2>&- || echo failed in 9
(echo 10 foo ${IFS+'bar} baz'}) 2>&- || echo failed in 10
(echo 11 "$(echo "${IFS+'}'z}")") 2>&- || echo failed in 11
(echo 12 "$(echo ${IFS+'}'z})") 2>&- || echo failed in 12
(echo 13 ${IFS+\}z}) 2>&- || echo failed in 13
(echo 14 "${IFS+\}z}") 2>&- || echo failed in 14
u=x; (echo -n '15 '; printf '<%s> ' "foo ${IFS+a"b$u{ {"{{\}b} c ${IFS+d{}} bar" ${IFS-e{}} baz; echo .) 2>&- || echo failed in 15
l=t; (echo 16 ${IFS+h`echo -n i ${IFS+$l}h`ere}) 2>&- || echo failed in 16
l=t; (echo 17 ${IFS+h$(echo -n i ${IFS+$l}h)ere}) 2>&- || echo failed in 17
l=t; (echo 18 "${IFS+h`echo -n i ${IFS+$l}h`ere}") 2>&- || echo failed in 18
l=t; (echo 19 "${IFS+h$(echo -n i ${IFS+$l}h)ere}") 2>&- || echo failed in 19
l=t; (echo 20 ${IFS+h`echo -n i "${IFS+$l}"h`ere}) 2>&- || echo failed in 20
l=t; (echo 21 ${IFS+h$(echo -n i "${IFS+$l}"h)ere}) 2>&- || echo failed in 21
l=t; (echo 22 "${IFS+h`echo -n i "${IFS+$l}"h`ere}") 2>&- || echo failed in 22
l=t; (echo 23 "${IFS+h$(echo -n i "${IFS+$l}"h)ere}") 2>&- || echo failed in 23
key=value; (echo -n '24 '; printf '%s\n' "${IFS+'$key'}") 2>&- || echo failed in 24
key=value; (echo -n '25 '; printf '%s\n' "${IFS+"'$key'"}") 2>&- || echo failed in 25 # ksh93: “'$key'”
key=value; (echo -n '26 '; printf '%s\n' ${IFS+'$key'}) 2>&- || echo failed in 26
key=value; (echo -n '27 '; printf '%s\n' ${IFS+"'$key'"}) 2>&- || echo failed in 27
(echo -n '28 '; printf '%s\n' "${IFS+"'"x ~ x'}'x"'}"x}" #') 2>&- || echo failed in 28
u=x; (echo -n '29 '; printf '<%s> ' foo ${IFS+a"b$u{ {"{ {\}b} c ${IFS+d{}} bar ${IFS-e{}} baz; echo .) 2>&- || echo failed in 29
(echo -n '30 '; printf '<%s> ' ${IFS+foo 'b\
ar' baz}; echo .) 2>&- || (echo failed in 30; echo failed in 31)
(echo -n '32 '; printf '<%s> ' ${IFS+foo "b\
ar" baz}; echo .) 2>&- || echo failed in 32
(echo -n '33 '; printf '<%s> ' "${IFS+foo 'b\
ar' baz}"; echo .) 2>&- || echo failed in 33
(echo -n '34 '; printf '<%s> ' "${IFS+foo "b\
ar" baz}"; echo .) 2>&- || echo failed in 34
(echo -n '35 '; printf '<%s> ' ${v=a\ b} x ${v=c\ d}; echo .) 2>&- || echo failed in 35
(echo -n '36 '; printf '<%s> ' "${v=a\ b}" x "${v=c\ d}"; echo .) 2>&- || echo failed in 36
(echo -n '37 '; printf '<%s> ' ${v-a\ b} x ${v-c\ d}; echo .) 2>&- || echo failed in 37
(echo 38 ${IFS+x'a'y} / "${IFS+x'a'y}" .) 2>&- || echo failed in 38
foo="x'a'y"; (echo 39 ${foo%*'a'*} / "${foo%*'a'*}" .) 2>&- || echo failed in 39
foo="a b c"; (echo -n '40 '; printf '<%s> ' "${foo#a}"; echo .) 2>&- || echo failed in 40
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./posixexp2.tests > /tmp/xx 2>&1
diff /tmp/xx posixexp2.right && rm -f /tmp/xx
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./posixexp.tests > /tmp/xx 2>&1
diff /tmp/xx posixexp.right && rm -f /tmp/xx