17 expect '<aaa bbb ccc>'
19 expect '<aaa bbb ccc>'
23 eval $1=\'$2\''${'$1':+":"${'$1'}}'; export $1
35 expect '<aaa bbb ccc>'
53 expect '<a b> <c> <d> <e> <f>'
59 expect '<a b> <c> <d> <e> <f>'
61 expect '<a b> <c> <d> <e> <f>'
68 # This changed after bash-3.0, when the tilde implementation was redone. It's
69 # not backward compatible, but it's very hard to be backward-compatible here,
70 # and I think the old behavior was a bug
74 recho "${somevar:-"~"}"
76 recho "${somevar:-\~}"
78 recho "${somevar:-\ \~}"
80 recho "${somevar:-\ \ \~}"
83 recho ${somevar:-$HOME}
85 recho "${somevar:-$HOME}"
87 recho "${somevar:-"$HOME"}"
89 recho "${somevar:-\$HOME}"
91 recho "${somevar:-\ \$HOME}"
93 recho "${somevar:-\ \ \$HOME}"
134 UNAME_RELEASE=${1:-4.2MP}
136 RELEASE=`expr "$UNAME_RELEASE" : '[^0-9]*\([0-9]*\)'` # 4
139 *) RELEASE=`expr "$RELEASE" + 0` ;;
141 REL_LEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'` # 1
142 REL_SUBLEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2
145 recho $RELEASE $REL_LEVEL $REL_SUBLEVEL
180 expect '<--+\> <+-->'
185 expect '<-+\> <+-\> <->'
211 recho ${undef-"x$*y"}
213 recho ${undef-"$*xy"}
215 recho ${undef-"xy$*"}
217 recho ${undef-x"$*"y}
219 recho ${undef-xy"$*"}
221 recho ${undef-"$*"xy}
228 recho ${undef-"$zzz"}
230 recho x${undef-"$zzz"}
236 recho ${undef-"$zzz"}x
271 # should give an error
280 recho $(echo "foo$(echo ")")")
282 # test backslash escapes
322 recho $(zecho `zecho \a`)
323 recho $(zecho `zecho \\a`)
325 recho $(zecho `zecho "\a"`)
326 recho $(zecho `zecho "\\a"`)
328 recho $(zecho `zecho '\a'`)
329 recho $(zecho `zecho '\\a'`)
331 # should echo G { I K }
332 recho ${abc:-G { I } K }
337 recho ${abc:-G { I } K }
345 echo "Number of args: $#"
346 echo "<\${*-x}>: <${*-x}>"
347 echo "<\${@-x}>: <${@-x}>"
365 recho ${#:-posparams}
391 recho ${#:-posparams}
396 recho ${!:-posparams}
422 expect a bad substitution error
424 expect a bad substitution error
426 expect a bad substitution error
428 expect a bad substitution error
430 expect a bad substitution error
432 expect a bad substitution error
435 expect a math syntax error
459 # variants of nested curly braces inside ${...} expressions
461 # IFS is not the standard one
463 expect '<G { I>' '<K>' '<}>'
464 recho ${gik:-G { I } K }
468 expect '<hi>' '<K>' '<}>'
469 recho ${abc:-G { I } K }
471 # reset IFS to the default
475 # nested ${...} inside ${...} are handled specially
477 expect '<xxx>' '<yyy>'
479 FOO=${BAR:-${XXX} yyy}
482 # this was a bug in versions of bash prior to bash-2.04-release
493 # this was a bug in bash-2.04, fixed in 2.05
495 expect '<:a:>' '<:b:>'
496 for i in "${@-}"; do recho :$i:; done
498 # I believe that ksh93 does these wrong -- we're using the rhs, so shouldn't
499 # it behave the same as ""?