commit bash-20100701 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 22:01:40 -05:00
parent 3d35553ad4
commit 7d92f73f39
56 changed files with 8704 additions and 5916 deletions
+10
View File
@@ -0,0 +1,10 @@
after 1: foo = a b c
after 2: tot = 6
after: 7
last = c
1 -- 142 1
0 -- 0 1 0
1 -- 0 0 1
1 -- 0 0 1
1 -- 0 1 0
lastpipe1.sub returns 14
+38
View File
@@ -0,0 +1,38 @@
shopt -s lastpipe
unset foo bar
echo a b c | read foo
echo after 1: foo = $foo
unset tot
declare -i tot
printf "%d\n" 1 2 3 | while read foo; do tot+=$foo; done
echo after 2: tot = $tot
unset bar
echo g h i | bar=7
echo after: $bar
unset foo last
printf "%s\n" a b c | while read foo; do last=$foo; done
echo last = $last
exit 142 | false
echo $? -- ${PIPESTATUS[@]}
true | false | /usr/bin/true
echo $? -- ${PIPESTATUS[@]}
true | /usr/bin/true | false
echo $? -- ${PIPESTATUS[@]}
set -o pipefail
true | /usr/bin/true | false
echo $? -- ${PIPESTATUS[@]}
true | /usr/bin/false | true
echo $? -- ${PIPESTATUS[@]}
set +o pipefail
${THIS_SH} ./lastpipe1.sub
echo lastpipe1.sub returns $?
+37
View File
@@ -0,0 +1,37 @@
shopt -s lastpipe
unset foo bar
echo a b c | read foo
echo after 1: foo = $foo
unset tot
declare -i tot
printf "%d\n" 1 2 3 | while read foo; do tot+=$foo; done
echo after 2: tot = $tot
unset bar
echo g h i | bar=7
echo after: $bar
unset foo last
printf "%s\n" a b c | while read foo; do last=$foo; done
echo last = $last
exit 142 | false
echo $? -- ${PIPESTATUS[@]}
true | false | /usr/bin/true
echo $? -- ${PIPESTATUS[@]}
true | /usr/bin/true | false
echo $? -- ${PIPESTATUS[@]}
set -o pipefail
true | /usr/bin/true | false
echo $? -- ${PIPESTATUS[@]}
true | /usr/bin/false | true
echo $? -- ${PIPESTATUS[@]}
set +o pipefail
${THIS_SH} ./lastpipe1.sub
+5
View File
@@ -0,0 +1,5 @@
# with lastpipe set, exit at the end of a pipeline exits
# the calling shell
shopt -s lastpipe
exit 142 | exit 14
echo after: $?
+4
View File
@@ -0,0 +1,4 @@
# with lastpipe set, exit at the end of a pipeline exits
# the calling shell
exit 142 | exit 14
echo after: $?
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./lastpipe.tests > /tmp/xx 2>&1
diff /tmp/xx lastpipe.right && rm -f /tmp/xx
+6
View File
@@ -0,0 +1,6 @@
echo "warning: UNIX versions number signals and schedule processes differently." >&2
echo "warning: If output differing only in line numbers is produced, please" >&2
echo "warning: do not consider this a test failure." >&2
${THIS_SH} ./trap.tests > /tmp/xx 2>&1
diff /tmp/xx trap.right && rm -f /tmp/xx
+3
View File
@@ -29,6 +29,7 @@ shopt -u histverify
shopt -s hostcomplete
shopt -u huponexit
shopt -s interactive_comments
shopt -u lastpipe
shopt -u lithist
shopt -u login_shell
shopt -u mailwarn
@@ -79,6 +80,7 @@ shopt -u histappend
shopt -u histreedit
shopt -u histverify
shopt -u huponexit
shopt -u lastpipe
shopt -u lithist
shopt -u login_shell
shopt -u mailwarn
@@ -111,6 +113,7 @@ histappend off
histreedit off
histverify off
huponexit off
lastpipe off
lithist off
login_shell off
mailwarn off