commit bash-20180406 snapshot

This commit is contained in:
Chet Ramey
2018-04-12 15:09:21 -04:00
parent 13b0033c46
commit d155fbc5fd
20 changed files with 294 additions and 24 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
+16
View File
@@ -36,3 +36,19 @@ ok 5
ok 6
ok 7
ok 8
--- testing: soh
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
--- testing: stx
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
ok1ok2ok3ok4ok5
+1
View File
@@ -52,3 +52,4 @@ case " " in ( [" "] ) echo ok;; ( * ) echo no;; esac
# tests of quote removal and pattern matching
${THIS_SH} ./case1.sub
${THIS_SH} ./case2.sub
${THIS_SH} ./case3.sub
+37
View File
@@ -0,0 +1,37 @@
#!/bin/sh
testmatch() {
case $1 in
( $2 ) printf ok1 ;;
( * ) printf fail1 ;;
esac
case $1,$2 in
( $2,"$2" ) printf ok2 ;;
( * ) printf fail2 ;;
esac
case $1, in
( $2, ) printf ok3 ;;
( * ) printf fail3 ;;
esac
case ,$2 in
( ,"$2" ) printf ok4 ;;
( * ) printf fail4 ;;
esac
case "$1,$2" in
( $2,"$2" ) printf ok5 ;;
( * ) printf fail5 ;;
esac
echo
}
for c in $'\1' $'\2'; do
echo -n "--- testing: "
echo "$c" | od -t a | awk 'NR==1 { print $2 } '
testmatch "${c}" "\\${c}"
testmatch "${c}x" "\\${c}\\x" # bash-git fails case 2 and 5 for $'\1'
testmatch "${c}x" "${c}\\x"
testmatch "${c}x" "${c}x"
testmatch "${c}x" "\\${c}x"
testmatch "x${c}" "\\x\\${c}"
testmatch "x${c}" "x\\${c}"
done
+8
View File
@@ -84,6 +84,14 @@ hello
end hello<NL>\END
./heredoc3.sub: line 85: warning: here-document at line 83 delimited by end-of-file (wanted `EOF')
./heredoc3.sub: line 86: syntax error: unexpected end of file
heredoc1
EOF
Ok:0
argv[1] = <onetwo>
argv[2] = <threefour>
argv[1] = <two>
argv[2] = <threefi>
argv[3] = <ve>
comsub here-string
./heredoc.tests: line 105: warning: here-document at line 103 delimited by end-of-file (wanted `EOF')
hi
+1 -1
View File
@@ -90,8 +90,8 @@ ${THIS_SH} ./heredoc1.sub
# test heredocs in command substitutions
${THIS_SH} ./heredoc2.sub
${THIS_SH} ./heredoc3.sub
${THIS_SH} ./heredoc4.sub
echo $(
cat <<< "comsub here-string"
+12
View File
@@ -0,0 +1,12 @@
cat <<EO`true`F
heredoc1
EO`false`F
EO`true`F
echo Ok:$?
one=one
four=four
five='fi ve'
recho $one`echo two three`$four
recho `echo two three`$five
+5 -5
View File
@@ -16,11 +16,11 @@ Waiting for job 6
job 6 returns 0
Waiting for job 7
job 7 returns 0
[1] Running sleep 5 &
[2] Running sleep 5 &
[3] Running sleep 5 &
[4]- Running sleep 5 &
[5]+ Running ( sleep 5; exit 4 ) &
[1] Running sleep 2 &
[2] Running sleep 2 &
[3] Running sleep 2 &
[4]- Running sleep 2 &
[5]+ Running ( sleep 2; exit 4 ) &
4
0
i killed it
+8
View File
@@ -64,6 +64,14 @@ after while
before false in trap2a.sub
after false in trap2a.sub
command substitution
ERRTRAP
ERRTRAP
bar
ERRTRAP
ERRTRAP
ERRTRAP
ERRTRAP
ERRTRAP
+[6] echo 1
1
+[7] echo 2
+24
View File
@@ -23,3 +23,27 @@ echo after while
./trap2a.sub
echo $(false ; echo command substitution)
# test behavior of failed commands following `command' builtin
command false
(command false)
command false | echo bar
(false)
exit 42 | command false
command command command false
unset FALSE
if [ -x /bin/false ]; then
FALSE=/bin/false
elif [ -x /usr/bin/false ]; then
FALSE=/usr/bin/false
else
FALSE='command false'
fi
command $FALSE
command command command $FALSE