commit bash-20090115 snapshot

This commit is contained in:
Chet Ramey
2011-12-07 09:35:52 -05:00
parent 4f562c6df4
commit e141c35a07
121 changed files with 1640 additions and 16260 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
+12 -2
View File
@@ -27,9 +27,19 @@ acknowledgement oenophile
ackNowLEdgEmENT oENophiLE
acknowledgement oenophile
ackNowLEdgEmENT oENophiLE
ackNowLEdgEmENT oENophiLE
acknowledgement oenophile
ackNowLEdgEmENT oENophiLE
acknowledgement oenophile
acknowledgement oenophile
acknowledgement oenophile
Acknowledgement Oenophile
ACKNOWLEDGEMENT OENOPHILE
BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT
be conservative in what you send and liberal in what you accept
Be Conservative in what you send and Liberal in what you accept
Be conservative in what you send and liberal in what you accept
be Conservative in what you send and Liberal in what you accept
be conservative in what you send and liberal in what you accept
Be Conservative in what you send and Liberal in what you accept
BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT
Be conservative in what you send and liberal in what you accept
BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT
+27
View File
@@ -70,3 +70,30 @@ echo ${@,,[rstlne]}
echo ${@^?}
echo ${@^^?}
# make sure that multiple words in the string are handled as other expansions
TEXT="Be Conservative in what you send and Liberal in what you accept"
TEXT2="be conservative in what you send and liberal in what you accept"
declare -u foo
foo=$TEXT
echo $foo
declare -l bar
bar=$TEXT
echo $bar
declare -c qux
qux=$TEXT
echo $qux
qux=$TEXT2
echo $qux
echo ${TEXT,}
echo ${TEXT,,}
echo ${TEXT^}
echo ${TEXT^^}
echo ${TEXT2^}
echo ${TEXT2^^}
+96
View File
@@ -0,0 +1,96 @@
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 ${@^^?}
# make sure that multiple words in the string are handled as other expansions
TEXT="Be Conservative in what you send and Liberal in what you accept"
TEXT2="be conservative in what you send and liberal in what you accept"
declare -u foo
foo=$TEXT
echo $foo
declare -l bar
bar=$TEXT
echo $bar
declare -c qux
qux=$TEXT
echo $qux
qux=$TEXT2
echo $qux
echo ${TEXT,}
echo ${TEXT,,}
echo ${TEXT^}
echo ${TEXT^^}
+12 -5
View File
@@ -31,6 +31,7 @@ a[0] Abcdefghijklmnop
[e] abcdefghijklmnOp
[f] abcdefghijklmnoP
a
0
1
2
3
@@ -47,11 +48,11 @@ a
14
15
16
3
6
9
12
15
2
5
8
11
14
[0] Abcdefghijklmnop
[1] aBcdefghijklmnop
[2] abCdefghijklmnop
@@ -129,3 +130,9 @@ a
[27] aaa
[28] aaa
[29] aaa
1 2 3 4 5
foo 0
foo 1
foo 2
foo 3
foo 4
+2
View File
@@ -38,3 +38,5 @@ mapfile -O 10 -n 5 -t E < mapfile.data
for (( i = 0 ; i < ${#E[@]} ; i++ )); do
echo "${E[${i}]}"
done
${THIS_SH} ./mapfile1.sub
+42
View File
@@ -0,0 +1,42 @@
declare -a A
mapfile A < mapfile.data
for (( i = 0 ; i < ${#A[@]} ; i++ )); do
echo -n "${A[${i}]}"
done
declare -a B
mapfile -t B < mapfile.data
for (( i = 0 ; i < ${#B[@]} ; i++ )); do
echo "${B[${i}]}"
done
mapfile -C "echo" -c 1 A < mapfile.data
mapfile -C "echo" -c 3 A < mapfile.data
mapfile -C "echo" -c 19 A < mapfile.data
declare -a C
mapfile -t -u 3 C 3< mapfile.data < mapfile.tests
for (( i = 0 ; i < ${#C[@]} ; i++ )); do
echo "${C[${i}]}"
done
declare -a D
for (( i = 0 ; i < 30; i++ )); do
D[${i}]="[$i] aaa"
done
mapfile -O 10 -t D < mapfile.data
for (( i = 0 ; i < ${#D[@]} ; i++ )); do
echo "${D[${i}]}"
done
declare -a E
for (( i = 0 ; i < 30; i++ )); do
E[${i}]="[$i] aaa"
done
mapfile -O 10 -n 5 -t E < mapfile.data
for (( i = 0 ; i < ${#E[@]} ; i++ )); do
echo "${E[${i}]}"
done
# ${THIS_SH} ./mapfile1.sub
+11
View File
@@ -0,0 +1,11 @@
: ${TMPDIR:=/tmp}
FILE=$TMPDIR/file
trap 'rm -f $FILE' 0 1 2 3 6 15
printf "%d\n" {1..20} > $FILE
mapfile -n 5 array < $FILE
echo ${array[@]}
mapfile -n 5 -c 1 -C "echo foo" array < $FILE
mapfile -n 5 -c 1 -C "echo foo" array < /dev/null
+11
View File
@@ -0,0 +1,11 @@
: ${TMPDIR:=/tmp}
FILE=$TMPDIR/file
trap 'rm -f $FILE' 0 1 2 3 6 15
echo {1..20} > $FILE
mapfile -n 5 array < $FILE
echo ${array[@]}
mapfile -n 5 -c 1 -C "echo foo" array < $FILE
mapfile -n 5 -c 1 -C "echo foo" array < /dev/null
+2 -2
View File
@@ -1,6 +1,6 @@
# test read with a timeout of 0 -- input polling
echo abcde | { sleep 0.25 ; read -t 0; }
# sleep with fractional seconds argument is not universal
echo abcde | { sleep 0.25 2>/dev/null ; read -t 0; }
echo $?
read -t 0 < $0