Dan Douglas <orm...@gmail.com> writes:

> Hi, hopefully a self-explanatory one today:
>
>     ~ $ ( set -x -- {a..c}; echo "${*-"{1..3}"}" )
>     + echo 'a b c' 'a b c' 'a b c'
>     a b c a b c a b c
>
>     ~ $ ( set -x -- {a..c}; echo "${*/"{1..3}"/$*}" )
>     + echo 'a b c' 'a b c' 'a b c'
>     a b c a b c a b c

*Note (bash) Brace Expansion::

   Brace expansion is performed before any other expansions, and any
characters special to other expansions are preserved in the result.  It
is strictly textual.  Bash does not apply any syntactic interpretation
to the context of the expansion or the text between the braces.  To
avoid conflicts with parameter expansion, the string `${' is not
considered eligible for brace expansion.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to