[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: incorrect brace expansion when using default values
From: |
Alexander Elgert |
Subject: |
Re: incorrect brace expansion when using default values |
Date: |
Fri, 8 Sep 2006 23:21:15 +0200 |
User-agent: |
Mutt/1.4.1i |
Tatavarty Kalyan schrieb am 08.09.2006 um 11:44:47 (+0800):
> >It is because the string
> > a{b,c}
> >is outside of the quotes. So the brace expansion comes first and
> >duplicates
> >the arguments to the echo call.
>
> Yes, as you said the brace expansion is outside the double quotes so
> shouldn't it be more like:
> $ foo() { echo "${1:-"ab"}" "${1:-"ac"}" ; }
Yes, of course. ;)
It so simple, just eval the braces and nothing else.
I did one step too much and discovered that ab is atomar and underlies no
further evaluation.
So my assumption is correct for this example only, but not for any possible
string replacing ab as yours.
Alexander