commit bash-20151230 snapshot

This commit is contained in:
Chet Ramey
2016-01-04 09:18:44 -05:00
parent 25340ead08
commit 6f82653c5e
28 changed files with 1010 additions and 778 deletions
+1
View File
@@ -218,6 +218,7 @@ ${THIS_SH} ./dollar-at-star3.sub
${THIS_SH} ./dollar-at-star4.sub
${THIS_SH} ./dollar-at-star5.sub
${THIS_SH} ./dollar-at-star6.sub
${THIS_SH} ./dollar-at-star7.sub
# tests for special expansion of "$*" and "${array[*]}" when used with other
# expansions -- bugs through bash-2.05b
+25
View File
@@ -0,0 +1,25 @@
IFS='' # testing with only empty IFS
set -- this is a test
printf '|%s|\n' ${1+"$@"}
echo
printf '|%s|\n' "${1+$@}"
echo
printf '|%s|\n' "$@"
echo
printf '|%s|\n' ${1-"$@"}
printf '|%s|\n' "${1-$@}"
echo
: ${foo:="$@"}
printf '|%s|\n' "$foo"
unset foo
: "${foo:=$@}"
printf '|%s|\n' "$foo"
unset foo
printf '|%s|\n' ${foo-"$@"}
printf '|%s|\n' "${foo-$@}"
+28
View File
@@ -266,6 +266,34 @@ argv[3] = <'c'>
argv[1] = <'a'>
argv[2] = <'b'>
argv[3] = <'c'>
|this|
|is|
|a|
|test|
|this|
|is|
|a|
|test|
|this|
|is|
|a|
|test|
|this|
|this|
|this is a test|
|this is a test|
|this|
|is|
|a|
|test|
|this|
|is|
|a|
|test|
xa|xb|xc
xa|xb|xc
a|b|c
+39
View File
@@ -150,3 +150,42 @@ echo "#!/bin/bash" set -o posix
#!/bin/bash set -o posix
!!
!!
a
echo $(echo echo a)
echo a
a
echo echo a $(echo echo a)
echo a echo a
b
!! $(echo !!)
c
echo "echo c" "$(echo echo c)"
echo c echo c
d
echo "echo d" $(echo "echo d")
echo d echo d
e
!! !!
f
!!
f
!!
g
echo "echo g"
echo g
g
eval echo "echo g"
echo g
a
cat < <(echo echo a)
echo a
b
echo echo b `echo echo b`
echo b echo b
c
!
d
!
e
! !
./histexp4.sub: line 20: !': event not found
+2
View File
@@ -130,3 +130,5 @@ echo !shopt*
${THIS_SH} ./histexp1.sub
${THIS_SH} ./histexp2.sub
${THIS_SH} ./histexp3.sub
${THIS_SH} ./histexp4.sub
+35
View File
@@ -0,0 +1,35 @@
HISTFILE=${TMPDIR}/bashhist-$$
set -o history
set -o histexpand
echo a
echo $(echo !!)
echo a
echo !! $(echo !!)
echo b
echo '!!' '$(echo !!)'
echo c
echo "!!" "$(echo !!)"
echo d
echo "!!" $(echo "!!")
echo e
echo '!!' $(echo '!!')
echo f
echo '!!'
echo f
eval echo '!!'
echo g
echo "!!"
echo g
eval echo "!!"
set +o history
rm -f $HISTFILE # just in case
+23
View File
@@ -0,0 +1,23 @@
HISTFILE=$TMPDIR/bashhist-$$
set -o history
set -o histexpand
echo a
cat < <(echo !!)
echo b
echo !! `echo !!`
echo c
echo "$(echo "!" )"
echo d
echo "$(echo '!' )"
echo e
echo '!' "!"
echo "'!'"
set +o history
rm -f $HISTFILE