Imported from ../bash-2.04.tar.gz.

This commit is contained in:
Jari Aalto 2000-03-17 21:46:59 +00:00
commit bb70624e96
387 changed files with 28522 additions and 9334 deletions

View file

@ -227,6 +227,15 @@ recho ${@//%x*/yyy}
expect a newline
echo $abmcde
# sneaky way to replace a newline in a variable value with something else
AVAR=$'This\nstring\nhas\nmultiple\nlines.'
echo "${AVAR}"
eval BVAR=\"\${AVAR//$'\n'/-}\"
echo "$BVAR"
unset AVAR BVAR
# run process substitution tests in a subshell so that syntax errors
# caused by a shell not implementing process substitution (e.g., one
# built on a NeXT) will not cause the whole test to exit prematurely
@ -402,6 +411,11 @@ recho ${xxx//$yyy/*}
recho ${xxx/$zzz/*}
recho ${xxx//$zzz/*}
recho ${xxx//%${zzz}/}
recho ${xxx//%${zzz}}
recho ${xxx//#${zzz}/}
recho ${xxx//#${zzz}}
# another case that caused a core dump in bash-2.0
XPATH=/usr/bin:/bin:/usr/local/bin:/usr/gnu/bin::/usr/bin/X11:/sbin:/usr/sbin
@ -455,6 +469,32 @@ recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
RECEIVED=""
recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
# tests of new prefix expansion ${!prefix*}
${THIS_SH} ./new-exp3.sub
# these caused errors and core dumps in versions before bash-2.04
c=""
echo ${c//${$(($#-1))}/x/}
set a b c d e f g
recho "$@"
set -- ${@:1:$(($# - 2))}
recho "$@"
set a b
recho ${@:1:$(($# - 2))}
recho ${@:1:0}
recho ${@:1:1}
recho ${@:1:2}
recho "${*:1:0}"
# this is an error -- negative expression
set a
recho ${@:1:$(($# - 2))}
# this must be last!
expect $0: 'ABXD: parameter unset'
recho ${ABXD:?"parameter unset"}