commit bash-20080703 snapshot

This commit is contained in:
Chet Ramey
2011-12-07 09:25:28 -05:00
parent fdf670eaa1
commit 09767ff09d
113 changed files with 38264 additions and 36052 deletions
+25
View File
@@ -274,3 +274,28 @@ rdholz
rdho
argv[1] = <fooq//barq/>
argv[1] = <fooq>
argv[2] = <>
argv[3] = <barq>
argv[4] = <>
argv[1] = <foo!//bar!/>
argv[1] = <foo!>
argv[2] = <>
argv[3] = <bar!>
argv[4] = <>
argv[1] = <ooq//arq/>
argv[1] = <ooq>
argv[2] = <>
argv[3] = <arq>
argv[4] = <>
argv[1] = <Fooq//Barq/>
argv[1] = <Fooq>
argv[2] = <>
argv[3] = <Barq>
argv[4] = <>
argv[1] = <FOOQ//BARQ/>
argv[1] = <FOOQ>
argv[2] = <>
argv[3] = <BARQ>
argv[4] = <>
+2
View File
@@ -380,3 +380,5 @@ ${THIS_SH} ./array5.sub
# tests for post-bash-3.2 problems, most fixed in bash-3.2 patches
${THIS_SH} ./array6.sub
${THIS_SH} ./array7.sub
${THIS_SH} ./array8.sub
+23
View File
@@ -0,0 +1,23 @@
IFS=/
declare -a i
i[0]=fooq
i[1]=
i[2]=barq
i[3]=
recho "${i[*]:0}"
recho "${i[@]:0}"
recho "${i[*]/q/!}"
recho "${i[@]/q/!}"
recho "${i[*]#?}"
recho "${i[@]#?}"
# Need to complete this with case-modifying expansion examples
recho "${i[*]^?}"
recho "${i[@]^?}"
recho "${i[*]^^?}"
recho "${i[@]^^?}"
+30
View File
@@ -99,3 +99,33 @@ argv[1] = </bin/bash --login -o posix>
argv[2] = </usr/sbin/foo>
argv[3] = <cd /blat ; echo $PWD>
argv[4] = </usr/local/bin/qux -l>
outside: outside
declare -A BASH_ALIASES='()'
declare -A BASH_CMDS='()'
declare -A afoo='([six]="six" [foo bar]="foo quux" )'
argv[1] = <inside:>
argv[2] = <six>
argv[3] = <foo quux>
outside 2: outside
argv[1] = <fooq//barq/>
argv[1] = <fooq>
argv[1] = <foo!//bar!/>
argv[1] = <foo!>
argv[2] = <>
argv[3] = <bar!>
argv[4] = <>
argv[1] = <ooq//arq/>
argv[1] = <ooq>
argv[2] = <>
argv[3] = <arq>
argv[4] = <>
argv[1] = <Fooq//Barq/>
argv[1] = <Fooq>
argv[2] = <>
argv[3] = <Barq>
argv[4] = <>
argv[1] = <FOOQ//BARQ/>
argv[1] = <FOOQ>
argv[2] = <>
argv[3] = <BARQ>
argv[4] = <>
+4
View File
@@ -167,3 +167,7 @@ zecho "${xpath[@]//[\/]/\\}"
${THIS_SH} ./assoc1.sub
${THIS_SH} ./assoc2.sub
${THIS_SH} ./assoc3.sub
${THIS_SH} ./assoc4.sub
+15
View File
@@ -0,0 +1,15 @@
foo()
{
declare -A afoo=([six]="six" [foo bar]="foo quux")
declare -A
recho inside: "${afoo[@]}"
}
declare -A afoo=([main]=outside)
echo outside: "${afoo[@]}"
foo
echo outside 2: "${afoo[@]}"
+22
View File
@@ -0,0 +1,22 @@
IFS=/
declare -A i
i[0]=fooq
i[1]=
i[2]=barq
i[3]=
recho "${i[*]:0}"
recho "${i[@]:0}"
recho "${i[*]/q/!}"
recho "${i[@]/q/!}"
recho "${i[*]#?}"
recho "${i[@]#?}"
# Need to complete this with case-modifying expansion examples
recho "${i[*]^?}"
recho "${i[@]^?}"
recho "${i[*]^^?}"
recho "${i[@]^^?}"
+35
View File
@@ -0,0 +1,35 @@
Acknowledgement
ACKNOWLEDGEMENT
Oenophile
OEnOphIlE
aCKNOWLEDGEMENT
acknowledgement
oENOPHILE
oENOPHILE
oeNoPHiLe
Acknowledgement Oenophile
AcknOwlEdgEmEnt OEnOphIlE
aCKNOWLEDGEMENT oENOPHILE
aCKNoWLeDGeMeNT oeNoPHiLe
aCKNOWLEDGEMENT oENOPHILE
acknowledgement oenophile
Acknowledgement Oenophile
ACKNOWLEDGEMENT OENOPHILE
Acknowledgement Oenophile
AcknOwlEdgEmEnt OEnOphIlE
oENOPHILE aCKNOWLEDGEMENT
oenophile acknowledgement
oENOPHILE aCKNOWLEDGEMENT
oeNoPHiLe aCKNoWLeDGeMeNT
Acknowledgement Oenophile
ACKNOWLEDGEMENT OENOPHILE
acknowledgement oenophile
ackNowLEdgEmENT oENophiLE
acknowledgement oenophile
ackNowLEdgEmENT oENophiLE
ackNowLEdgEmENT oENophiLE
acknowledgement oenophile
ackNowLEdgEmENT oENophiLE
acknowledgement oenophile
Acknowledgement Oenophile
ACKNOWLEDGEMENT OENOPHILE
+72
View File
@@ -0,0 +1,72 @@
S1=acknowledgement
S2=oenophile
echo ${S1^}
echo ${S1^^}
echo ${S2^[aeiou]}
echo ${S2^^[aeiou]}
U1=${S1^^}
U2=${S2^^}
echo ${U1,}
echo ${U1,,}
echo ${U2,}
echo ${U2,[AEIOU]}
echo ${U2,,[AEIOU]}
A1=( $S1 $S2 )
echo ${A1[@]^[aeiou]}
echo ${A1[@]^^[aeiou]}
A2=( $U1 $U2 )
echo ${A2[@],[AEIOU]}
echo ${A2[@],,[AEIOU]}
echo ${A2[@],?}
echo ${A2[@],,?}
declare -A AA1 AA2
AA1[ack]=$S1
AA1[oen]=$S2
echo ${AA1[@]^}
echo ${AA1[@]^^}
echo ${AA1[@]^[aeiou]}
echo ${AA1[@]^^[aeiou]}
AA2[ACK]=$U1
AA2[OEN]=$U2
echo ${AA2[@],}
echo ${AA2[@],,}
echo ${AA2[@],[AEIOU]}
echo ${AA2[@],,[AEIOU]}
set -- $S1 $S2
echo ${@^}
echo ${@^^}
echo ${S1^[rstlne]} ${S2^[rstlne]}
echo ${S1^^[rstlne]} ${S2^^[rstlne]}
echo ${@^[rstlne]}
echo ${@^^[rstlne]}
echo ${S1,[rstlne]} ${S2,[rstlne]}
echo ${S1,,[rstlne]} ${S2,,[rstlne]}
echo ${@,[rstlne]}
echo ${@,,[rstlne]}
echo ${@^?}
echo ${@^^?}
+7
View File
@@ -0,0 +1,7 @@
./comsub-eof0.sub: line 1: unexpected EOF while looking for matching `)'
./comsub-eof0.sub: line 5: syntax error: unexpected end of file
hi
./comsub-eof2.sub: line 2: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
hi
./comsub-eof3.sub: line 1: unexpected EOF while looking for matching `)'
./comsub-eof3.sub: line 5: syntax error: unexpected end of file
+7
View File
@@ -0,0 +1,7 @@
${THIS_SH} ./comsub-eof0.sub
${THIS_SH} ./comsub-eof1.sub
${THIS_SH} ./comsub-eof2.sub
${THIS_SH} ./comsub-eof3.sub
+4
View File
@@ -0,0 +1,4 @@
foo=$(cat <<EOF
hi
EOF )
echo $foo
+10
View File
@@ -0,0 +1,10 @@
foo=$(cat <<EOF
hi
EOF )
echo $foo
foo=`cat <<EOF
hi
EOF`
echo $foo
+4
View File
@@ -0,0 +1,4 @@
foo=`cat <<EOF
hi
EOF`
echo $foo
+10
View File
@@ -0,0 +1,10 @@
foo=$(cat <<EOF
hi
EOF )
echo $foo
foo=`cat <<EOF
hi
EOF`
echo $foo
+2
View File
@@ -0,0 +1,2 @@
cat <<EOF
hi
+4
View File
@@ -0,0 +1,4 @@
foo=$(cat <<EOF
hi
)
echo $foo
+14
View File
@@ -0,0 +1,14 @@
18530
63 60
a b c
18532
63 60
flop
./coproc.tests: line 22: 18532 Terminated coproc REFLECT { cat -; }
18534
63 60
FOO
63 60
root
daemon
-1 -1
+45
View File
@@ -0,0 +1,45 @@
coproc { echo a b c; sleep 2; }
echo $COPROC_PID
echo ${COPROC[@]}
read LINE <&${COPROC[0]}
echo $LINE
wait $COPROC_PID
coproc REFLECT { cat - ; }
echo $REFLECT_PID
echo ${REFLECT[@]}
echo flop >&${REFLECT[1]}
read LINE <&${REFLECT[0]}
echo $LINE
kill $REFLECT_PID
wait $REFLECT_PID
coproc tr -u 'a-z' 'A-Z'
echo $COPROC_PID
echo ${COPROC[@]}
echo foo >&${COPROC[1]}
read <&${COPROC[0]}
echo $REPLY
echo ${COPROC[@]}
cat /etc/passwd | grep root | awk -F: '{print $1;}'
exec 4<&${COPROC[0]}-
exec >&${COPROC[1]}-
echo ${COPROC[@]}
read foo <&4
echo $foo >&2
exit 0
+4
View File
@@ -223,4 +223,8 @@ ${THIS_SH} ./dollar-at2.sub
# no splitting, etc. when $IFS is NUL
${THIS_SH} ./dollar-star2.sub
# tests for expansions of "${array[*]}" and "${array[@]}" when $IFS is not the
# default and the array contains null elements
${THIS_SH} ./dollar-star3.sub
exit 0
+18
View File
@@ -0,0 +1,18 @@
IFS=/
#file=/mnt/cdrom/RedHat/RPMS
#recho "${file[*]:0:3}"
i[0]=fooq
i[1]=
i[2]=barq
i[3]=
recho "${i[*]:0}"
recho "${i[@]:0}"
recho "${i[*]/q/!}"
recho "${i[@]/q/!}"
recho "${i[*]#?}"
recho "${i[@]#?}"
# Need to complete this with case-modifying expansion examples
+15
View File
@@ -134,3 +134,18 @@ argv[1] = <A B>
argv[2] = <C D>
argv[1] = <A BC D>
argv[1] = <A BC D>
argv[1] = <fooq//barq/>
argv[1] = <fooq>
argv[2] = <>
argv[3] = <barq>
argv[4] = <>
argv[1] = <foo!//bar!/>
argv[1] = <foo!>
argv[2] = <>
argv[3] = <bar!>
argv[4] = <>
argv[1] = <ooq//arq/>
argv[1] = <ooq>
argv[2] = <>
argv[3] = <arq>
argv[4] = <>
+1 -1
View File
@@ -15,7 +15,7 @@ unset: usage: unset [-f] [-v] [name ...]
./errors.tests: line 52: unset: `/bin/sh': not a valid identifier
./errors.tests: line 55: unset: cannot simultaneously unset a function and a variable
./errors.tests: line 58: declare: -z: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
declare: usage: declare [-aAfFilrtux] [-p] [name[=value] ...]
./errors.tests: line 60: declare: `-z': not a valid identifier
./errors.tests: line 61: declare: `/bin/sh': not a valid identifier
./errors.tests: line 65: declare: cannot use `-f' to make functions
+1
View File
@@ -39,5 +39,6 @@ ENDOFINPUT
aa=1
}
./heredoc.tests: line 94: warning: here-document at line 92 delimited by end-of-file (wanted `EOF')
hi
there
+3 -3
View File
@@ -33,11 +33,11 @@ a = abcdefg
a = xyz
a = -xyz 123-
a = abc
1
timeout 1: ok
1
timeout 2: ok
./read2.sub: line 13: read: -3: invalid timeout specification
./read2.sub: line 23: read: -3: invalid timeout specification
1
abcde
+12 -2
View File
@@ -1,12 +1,22 @@
a=4
read -t 2 a < /dev/tty
echo $?
estat=$?
if [ $estat -gt 128 ]; then
echo timeout 1: ok
else
echo $estat
fi
echo $a
sleep 5 | read -t 1 a
echo $?
estat=$?
if [ $estat -gt 128 ]; then
echo timeout 2: ok
else
echo $estat
fi
echo $a
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./casemod.tests > /tmp/xx 2>&1
diff /tmp/xx casemod.right && rm -f /tmp/xx
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./comsub-eof.tests > /tmp/xx 2>&1
diff /tmp/xx comsub-eof.right && rm -f /tmp/xx
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./comsub.tests > /tmp/xx 2>&1
diff /tmp/xx comsub.right && rm -f /tmp/xx
+4
View File
@@ -0,0 +1,4 @@
echo "warning: the process IDs printed will differ on every run" >&2
echo "warning: and generate diffs" >&2
${THIS_SH} ./coproc.tests > /tmp/xx 2>&1
diff /tmp/xx coproc.right && rm -f /tmp/xx
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./coproc.tests > /tmp/xx 2>&1
diff /tmp/xx coproc.right && rm -f /tmp/xx