commit bash-20121228 snapshot

This commit is contained in:
Chet Ramey
2013-01-03 10:48:31 -05:00
parent 36eb585cfa
commit 7175a77f3a
56 changed files with 52723 additions and 10878 deletions
+10
View File
@@ -7,3 +7,13 @@ set -- ""
recho "A${*:-w}R"
recho "A${*-w}R"
recho "A${*}R"
set -- $'\177'
recho "A${*:+w}R"
recho "A${*+w}R"
recho "A${*}R"
recho A${*:+w}R
recho A${*+w}R
recho A${*}R
+6
View File
@@ -231,3 +231,9 @@ argv[1] = <AR>
argv[1] = <AwR>
argv[1] = <AR>
argv[1] = <AR>
argv[1] = <AwR>
argv[1] = <AwR>
argv[1] = <A^?R>
argv[1] = <AwR>
argv[1] = <AwR>
argv[1] = <A^?R>
+2 -2
View File
@@ -140,7 +140,7 @@ three
one
two
three
4.2
4.3
echo ${BASH_VERSION%\.*}
4.2
4.3
echo ${BASH_VERSION%\.*}
+2
View File
@@ -78,3 +78,5 @@ test'ing
test'ing
test'string
a'b'c
foo b c baz
foo 'bar baz
+6
View File
@@ -41,3 +41,9 @@ test=test\'string
echo "${test//"'"/"'"}"
x="a'b'c"; echo "${x//\'/\'}"
printf '%s\n' "foo ${IFS+"b c"} baz"
# this is where the default behavior differs from posix
set -o posix
echo "foo ${IFS+'bar} baz"
+5
View File
@@ -65,3 +65,8 @@ after failure 3
true || false no exit
false || true no exit
false && false no exit
A:
B:
ehB
C:
D:
+1
View File
@@ -108,3 +108,4 @@ set +e
${THIS_SH} ./set-e1.sub
${THIS_SH} ./set-e2.sub
${THIS_SH} ./set-e3.sub
+10
View File
@@ -0,0 +1,10 @@
foo()
{
echo A:
. ./set-e3a.sub
echo D:
}
# should run all the way through; foo being called in a context where set -e
# is ignored means that that condition persists through sourcing the file
foo && true
+7
View File
@@ -0,0 +1,7 @@
echo B:
set -e
echo $-
false
echo C:
+9
View File
@@ -51,6 +51,15 @@ after fff3: x=4
|0|12|
|y|
|y|
a:b:c:d
a-b-c-d
a:b:c:d
g: ,
f: ,
FIN: asdf fdsa, asdf fdsa
g: v = , w =
f: v = , w =
FIN: v = two, w = one
a=z
a=b
a=z
+6
View File
@@ -202,5 +202,11 @@ $THIS_SH ./varenv1.sub
# more tests; bugs in bash up to version 2.05a
$THIS_SH ./varenv2.sub
# more tests; bugs in bash IFS scoping up through version 4.2
$THIS_SH ./varenv3.sub
# scoping problems with declare -g through bash-4.2
${THIS_SH} ./varenv4.sub
# make sure variable scoping is done right
tt() { typeset a=b;echo a=$a; };a=z;echo a=$a;tt;echo a=$a
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
oifs=$IFS
inner () {
#recho inner: "$IFS" >&2
echo a/b/c/d
exit 0
}
outer() {
#recho outer: "$IFS" >&2
for i in 1; do
IFS=/ read m v k a < <(IFS=$oifs inner)
echo $m:$v:$k:$a
done
}
outer
unset m k v a b c d
for j in 1; do
IFS=: read a b c d
done < <(outer)
echo $a-$b-$c-$d
unset m k v a b c d
IFS=: read a b c d < <(outer)
echo $a:$b:$c:$d
+44
View File
@@ -0,0 +1,44 @@
f()
{
local -a v
local -a w
g
echo "f: ${v[@]}, ${w[@]}"
}
g()
{
aux=v
declare -ga "$aux=( asdf fdsa )"
declare -ga w=( asdf fdsa )
echo "g: ${v[@]}, ${w[@]}"
}
f
echo "FIN: ${v[@]}, ${w[@]}"
unset v w
unset -f f g
f()
{
local v
local w
g
echo f: v = $v, w = $w
}
g()
{
aux=v
declare -g w=one
declare -g "$aux=two"
echo g: v = $v, w = $w
}
f
echo FIN: v = $v, w = $w