commit bash-20060302 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 22:45:57 -05:00
parent 27a1808ccd
commit 462a7a25f1
26 changed files with 9393 additions and 71 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
+9
View File
@@ -78,3 +78,12 @@ a b a,b a-b a.b a:b a;b a_b
a b a,b a-b a.b a:b a;b a_b
a b a,b a-b a.b a:b a;b a_b
argv[1] = <ef>
a.c
a.c
a.c
a.c
a.c
a.c
ok 1
ok 2
ok 3
+3 -1
View File
@@ -193,7 +193,7 @@ esac
MYDIR=$PWD # save where we are
TESTDIR=/tmp/eglob-test
TESTDIR=/tmp/eglob-test-$$
mkdir $TESTDIR
builtin cd $TESTDIR || { echo $0: cannot cd to $TESTDIR >&2 ; exit 1; }
rm -rf *
@@ -360,4 +360,6 @@ recho "${x#*(a|b)cd}"
# in the right place
builtin cd $MYDIR
${THIS_SH} ./extglob1.sub
exit 0
+37
View File
@@ -0,0 +1,37 @@
MYDIR=$PWD
: ${TMPDIR:=/tmp}
GDIR=$TMPDIR/gtest-$$
shopt -s extglob
mkdir $GDIR || exit 1
cd $GDIR || exit 1
touch a.c
echo +([[:alpha:].])
echo +([[:alpha:].])+([[:alpha:].])
echo *([[:alpha:].])
echo *([[:alpha:].])*([[:alpha:].])
echo ?([[:alpha:].])?([[:alpha:].])?([[:alpha:].])
echo @([[:alpha:].])@([[:alpha:].])@([[:alpha:].])
case . in
!([[:alpha:].]) ) echo bad 1;;
*) echo ok 1;;
esac
case . in
?([[:alpha:].]) ) echo ok 2;;
*) echo bad 2;;
esac
case . in
@([[:alpha:].]) ) echo ok 3;;
*) echo bad 3;;
esac
cd $MYDIR
rm -rf $GDIR
+3
View File
@@ -30,5 +30,8 @@ argv[1] = <hello, $"world">
argv[1] = <hello, \$"world">
argv[1] = <hello, $"world">
argv[1] = <hello, $world>
1
1
;foo
argv[1] = <^I>
argv[1] = <'A^IB'>
+6 -1
View File
@@ -102,7 +102,12 @@ recho $'hello, $\"world"'
recho "hello, $"world""
# ansi quoting inside double-quoted command subst - bash-3.1 bug
function args
echo $(set -- $'a b'; echo $#)
echo "$(set -- $'a b'; echo $#)"
echo "$(echo $';foo')"
args ()
{
for a in "$@";do echo "'$a'";done
}
+19
View File
@@ -47,3 +47,22 @@ argv[1] = <sed> argv[2] = <-e> argv[3] = <s/[^I:]//g>
argv[1] = <foo\^Jbar>
argv[1] = <foobar>
argv[1] = <foo\^Jbar>
b
a
b
c
argv[1] = <a\>
argv[2] = <b>
argv[1] = <$>
argv[2] = <bab>
argv[1] = <$foo>
argv[2] = <bab>
argv[1] = <$foo>
argv[2] = <bab>
argv[1] = <`>
argv[2] = <ab>
argv[1] = <\>
argv[2] = <ab>
${
argv[1] = <(")>
argv[1] = <(")>
+26
View File
@@ -83,3 +83,29 @@ bar'`
echo $(recho 'foo\
bar')
a=`echo 'a b c' | sed 's/ /\\
/g' | grep 'b'`
echo $a
a=`echo 'a b c' | sed 's/ /\\
/g'`
echo "$a"
recho `echo 'a\' b`
recho `echo '\$' bab`
recho `echo '\$foo' bab`
recho `echo '$foo' bab`
recho `echo '\`' ab`
recho `echo '\\' ab`
echo `echo '${'`
recho `echo "(\\")"`
# produces no output
: `: "\\""`
# ultimate workaround
recho `echo "(\")"`
+101
View File
@@ -0,0 +1,101 @@
echo "Single Quote"
echo 'foo
bar'
echo 'foo
bar'
echo 'foo\
bar'
echo "Double Quote"
echo "foo
bar"
echo "foo
bar"
echo "foo\
bar"
echo "Backslash Single Quote"
echo `echo 'foo
bar'`
echo `echo 'foo
bar'`
echo `echo 'foo\
bar'`
echo "Backslash Double Quote"
echo `echo "foo
bar"`
echo `echo "foo
bar"`
echo `echo "foo\
bar"`
echo "Double Quote Backslash Single Quote"
echo "`echo 'foo
bar'`"
echo "`echo 'foo
bar'`"
echo "`echo 'foo\
bar'`"
echo "Dollar Paren Single Quote"
echo $(echo 'foo
bar')
echo $(echo 'foo
bar')
echo $(echo 'foo\
bar')
echo "Dollar Paren Double Quote"
echo $(echo "foo
bar")
echo $(echo "foo
bar")
echo $(echo "foo\
bar")
echo "Double Quote Dollar Paren Single Quote"
echo "$(echo 'foo
bar')"
echo "$(echo 'foo
bar')"
echo "$(echo 'foo\
bar')"
# old-style command substitution parsing compatibility tests -- post bash-3.1
recho 'foo \\
bar'
recho 'foo \
bar'
echo `recho sed -e 's/[ :]/\\
/g'`
echo `recho sed -e 's/[ :]/\
/g'`
echo `recho 'foo\\
bar'`
echo `recho 'foo\
bar'`
echo $(recho 'foo\
bar')
a=`echo 'a b c' | sed 's/ /\\
/g' | grep 'b'`
echo $a
a=`echo 'a b c' | sed 's/ /\\
/g'`
echo "$a"
recho `echo 'a\' b`
recho `echo '\$' bab`
recho `echo '\$foo' bab`
recho `echo '\`' ab`
recho `echo '\\' ab`