Mike Frysinger <[EMAIL PROTECTED]> wrote:
> this little bit of code doesnt work right:
> foo() { echo "${1:-a{b,c}}" ; }
Brace expansion happens before parameter expansion (man bash,
EXPANSION). So the first "}" ends the parameter expression, and the
second "}" isn't special. The result of parameter expansion is not
subject to brace expansion.
> $ foo
> a{b,c}
This is correct. "a{b,c" is the default value, and "}" follows the
parameter expression.
> $ foo 1
> a}
I get "1}".
paul
_______________________________________________
Bug-bash mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-bash