commit bash-20150717 snapshot

This commit is contained in:
Chet Ramey
2015-07-29 16:16:37 -04:00
parent bce12dd773
commit 58a975cb0c
21 changed files with 243 additions and 40 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/bash/bash-current
BUILD_DIR=/usr/local/build/chet/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+16
View File
@@ -81,3 +81,19 @@ group pipeline: 1
EXIT-group.1
foo 0
after
exit code: 1
exit code: 1
exit code: 1
exit code: 127
exit code: 127
exit code: 127
a
b
c
A
B
c
d
c
d
e
+17
View File
@@ -0,0 +1,17 @@
: ${TMPDIR:=/var/tmp}
TMPFILE=$TMPDIR/exitcode
rm -f $TMPFILE
set -e
exit_handler() { echo "exit code: $?" ; touch $TMPFILE; }
false() { ! :; }
notfound() { nosuchcommand ; }
syntaxerror() { !:; }
main()
{(
trap exit_handler 0
"$@" >> /dev/null 2>&1
)}
main "$@"
echo "after main: should not get here"
+27
View File
@@ -128,3 +128,30 @@ ${THIS_SH} -c 'VAR=0; VAR=1 command exec; exit ${VAR}'
echo bad
) 2>/dev/null
[ $? = 127 ] || echo FAIL: bad exit status $? at $LINENO
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
# problem with undoing redirections before running exit trap through bash-4.3
${THIS_SH} ./exec12.sub false # function
${THIS_SH} ./exec12.sub command false
${THIS_SH} ./exec12.sub $FALSE
${THIS_SH} ./exec12.sub notfound
${THIS_SH} ./exec12.sub syntaxerror
${THIS_SH} ./exec12.sub nosuchcommand
# problem with fork optimization in bash-4.4-alpha
$THIS_SH -c 'echo a && /bin/echo b && echo c'
$THIS_SH -c 'echo A && /bin/echo B'
$THIS_SH -c '/bin/echo c && echo d'
$THIS_SH -c '/bin/echo c && /bin/echo d && echo e'
+13
View File
@@ -130,3 +130,16 @@ ok 3
echo shopt a
shopt a
echo a b c d 2 > /dev/null
!
!
!
!
!
!
!
!
!
\!
\!
\!
\!
+2
View File
@@ -127,3 +127,5 @@ shopt a b c d 2>/dev/null
echo !shopt-1
echo !shopt*
${THIS_SH} ./histexp1.sub
+23
View File
@@ -0,0 +1,23 @@
LC_ALL=C
LANG=C
set -o history
set -H
echo '!'
echo "!"
echo !
echo "$( echo '!' )"
echo "$( echo "!" )"
echo "$( echo ! )"
echo $( echo '!' )
echo $( echo "!" )
echo $( echo ! )
echo "$( echo "\!" )"
echo "\!"
echo "$( echo '\!' )"
echo '\!'