commit bash-20041005 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 13:37:16 -05:00
parent 22e63b05c8
commit 43df7bbb63
28 changed files with 805 additions and 89 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
+26
View File
@@ -0,0 +1,26 @@
match 1
match 2
match 3
match 4
match 1a
match 1b
match 2a
match 2b
match 3a
match 3b
match 4a
match 4b
match 5
match 6
match 7
match 8
match 9
match 10
match 11
match 12
match 13
match 14
match 15
match 16
match 17
match 18
+53
View File
@@ -0,0 +1,53 @@
shopt -s extglob
[[ ab/../ == @(ab|+([^/]))/..?(/) ]] && echo match 1
[[ ab/../ == +([^/])/..?(/) ]] && echo match 2
[[ ab/../ == @(ab|?b)/..?(/) ]] && echo match 3
[[ ab/../ == +([^/])/../ ]] && echo match 4
[[ ab/../ == +([!/])/..?(/) ]] && echo match 1a
[[ ab/../ == @(ab|+([!/]))/..?(/) ]] && echo match 1b
[[ ab/../ == +([!/])/../ ]] && echo match 2a
[[ ab/../ == +([!/])/..?(/) ]] && echo match 2b
[[ ab/../ == +([!/])/..@(/) ]] && echo match 3a
[[ ab/../ == +(ab)/..?(/) ]] && echo match 3b
[[ ab/../ == [!/][!/]/../ ]] && echo match 4a
[[ ab/../ == @(ab|?b)/..?(/) ]] && echo match 4b
[[ ab/../ == [^/][^/]/../ ]] && echo match 5
[[ ab/../ == ?b/..?(/) ]] && echo match 6
[[ ab/../ == +(?b)/..?(/) ]] && echo match 7
[[ ab/../ == +(?b|?b)/..?(/) ]] && echo match 8
[[ ab/../ == @(?b|?b)/..?(/) ]] && echo match 9
[[ ab/../ == @(a?|?b)/..?(/) ]] && echo match 10
[[ ab/../ == ?(ab)/..?(/) ]] && echo match 11
[[ ab/../ == ?(ab|??)/..?(/) ]] && echo match 12
[[ ab/../ == @(??)/..?(/) ]] && echo match 13
[[ ab/../ == @(??|a*)/..?(/) ]] && echo match 14
[[ ab/../ == @(a*)/..?(/) ]] && echo match 15
[[ ab/../ == +(??)/..?(/) ]] && echo match 16
[[ ab/../ == +(??|a*)/..?(/) ]] && echo match 17
[[ ab/../ == +(a*)/..?(/) ]] && echo match 18
+4
View File
@@ -0,0 +1,4 @@
PATH=$PATH:`pwd`
export PATH
${THIS_SH} ./extglob3.tests > /tmp/xx
diff /tmp/xx extglob3.right && rm -f /tmp/xx
+1 -1
View File
@@ -1,2 +1,2 @@
${THIS_SH} ./tilde-tests > /tmp/xx
${THIS_SH} ./tilde.tests > /tmp/xx
diff /tmp/xx tilde.right && rm -f /tmp/xx
+2
View File
@@ -0,0 +1,2 @@
${THIS_SH} ./tilde2.tests > /tmp/xx
diff /tmp/xx tilde2.right && rm -f /tmp/xx
+66
View File
@@ -0,0 +1,66 @@
# this is needed because posix mode restricts tilde expansion to assignment
# statements preceding a command, instead of the default of expanding all
# assignment statements on the line (e.g., after `export'). Without this,
# the next-to-last test fails
set +o posix
HOME=/usr/xyz
SHELL=~/bash
echo ~ch\et
echo ~/"foo"
echo "~chet"/"foo"
echo \~chet/"foo"
echo \~chet/bar
echo ~\chet/bar
echo ~chet""/bar
echo ":~chet/"
echo abcd~chet
echo "SHELL=~/bash"
echo $SHELL
echo abcd:~chet
path=/usr/ucb:/bin:~/bin:~/tmp/bin:/usr/bin
echo $path
cd /usr
cd /tmp
echo ~-
echo ~+
XPATH=/bin:/usr/bin:.
# yes tilde expansion
PPATH=$XPATH:~/bin
echo "$PPATH"
# no tilde expansion
PPATH="$XPATH:~/bin"
echo "$PPATH"
# yes tilde expansion
export PPATH=$XPATH:~/bin
echo "$PPATH"
declare -x PPATH=$XPATH:~/bin
echo "$PPATH"
# no tilde expansion
export PPATH="$XPATH:~/bin"
echo "$PPATH"
declare -x PPATH="$XPATH:~/bin"
echo "$PPATH"
# more tests of tilde expansion when executing case commands
case ~ in
$HOME) echo ok 1;;
*) echo bad 1 ;;
esac
case ~ in
~) echo ok 2 ;;
\~) echo bad 2a ;;
*) echo bad 2b ;;
esac
case $unset in
"") echo ok 3 ;;
*) echo bad 3 ;;
esac
+17
View File
@@ -0,0 +1,17 @@
PATH=~/bin:/bin:/usr/bin:.
/usr/xyz/bin:~/bin2:/bin:/usr/bin:.
PATH=~/bin:~/bin2:/bin:/usr/bin:.
~/bin
~
/usr/xyz
~
~
~
argv[1] = <\a>
argv[1] = <\a>
/usr/xyz/bash
ok
~
~
make -k FOO=/usr/xyz/mumble
/usr/xyz/mumble
+46
View File
@@ -0,0 +1,46 @@
HOME=/usr/xyz
XPATH=/bin:/usr/bin:.
ADDPATH=PATH=~/bin:$XPATH
echo $ADDPATH
unset ADDPATH
: ${ADDPATH:=~/bin:~/bin2:$XPATH}
echo $ADDPATH
unset ADDPATH
: ${ADDPATH:=PATH=~/bin:~/bin2:$XPATH}
echo $ADDPATH
cat << !
~/bin
!
echo "~"
echo ${TPATH:-~}
echo "${TPATH:-~}"
echo "${TPATH:-"~"}"
echo "${XPATH+~}"
recho "\a"
recho "${TPATH:-\a}"
SHELL=~/bash
echo $SHELL
case $SHELL in
~/bash) echo ok;;
*) echo bad;;
esac
somevar=
echo "${somevar:-~}"
echo "${somevar:-"~"}"
echo make -k FOO=~/mumble
typeset FOO=~/mumble
echo "$FOO"