mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-11 12:40:42 +02:00
commit bash-20151230 snapshot
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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-$@}"
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -130,3 +130,5 @@ echo !shopt*
|
||||
|
||||
${THIS_SH} ./histexp1.sub
|
||||
${THIS_SH} ./histexp2.sub
|
||||
${THIS_SH} ./histexp3.sub
|
||||
${THIS_SH} ./histexp4.sub
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user