Re: incorrect brace expansion when using default values

2006-09-08 Thread Chet Ramey
Chris F.A. Johnson wrote: >Quote them, and they do expand: > > $ foo() { echo "${1:-"a{b,c}"}" ; } > $ foo > ab ac Brace expansion is essentially separate from the rest of the expansions: in fact, it's designed to be part of a separate library if desired. As such, it doesn't implement all o

Re: incorrect brace expansion when using default values

2006-09-08 Thread Alexander Elgert
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 > s

Re: incorrect brace expansion when using default values

2006-09-07 Thread Tatavarty Kalyan
On 9/8/06, Alexander Elgert <[EMAIL PROTECTED]> wrote: Tatavarty Kalyan schrieb am 07.09.2006 um 14:20:43 (+0800): > On 9/6/06, Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: > > > >On 2006-09-06, Andreas Schwab wrote: > >> [EMAIL PROTECTED] (Paul Jarc) writes: > >> > >>> Mike Frysinger <[EMAIL P

Re: incorrect brace expansion when using default values

2006-09-07 Thread Alexander Elgert
Tatavarty Kalyan schrieb am 07.09.2006 um 14:20:43 (+0800): > On 9/6/06, Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: > > > >On 2006-09-06, Andreas Schwab wrote: > >> [EMAIL PROTECTED] (Paul Jarc) writes: > >> > >>> Mike Frysinger <[EMAIL PROTECTED]> wrote: > this little bit of code doesnt wo

Re: incorrect brace expansion when using default values

2006-09-06 Thread Tatavarty Kalyan
On 9/6/06, Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: On 2006-09-06, Andreas Schwab wrote: > [EMAIL PROTECTED] (Paul Jarc) writes: > >> Mike Frysinger <[EMAIL PROTECTED]> wrote: >>> this little bit of code doesnt work right: >>> foo() { echo "${1:-a{b,c}}" ; } The first '}' is interpreted

Re: incorrect brace expansion when using default values

2006-09-06 Thread Chris F.A. Johnson
On 2006-09-06, Andreas Schwab wrote: > [EMAIL PROTECTED] (Paul Jarc) writes: > >> Mike Frysinger <[EMAIL PROTECTED]> wrote: >>> this little bit of code doesnt work right: >>> foo() { echo "${1:-a{b,c}}" ; } The first '}' is interpreted as the end of the parameter expansion. >> >> Brace expansi

Re: incorrect brace expansion when using default values

2006-09-06 Thread Mike Frysinger
On Wednesday 06 September 2006 05:04, Andreas Schwab wrote: > [EMAIL PROTECTED] (Paul Jarc) writes: > > 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

Re: incorrect brace expansion when using default values

2006-09-06 Thread Andreas Schwab
[EMAIL PROTECTED] (Paul Jarc) writes: > 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). Brace expansion doesn't come into play here, because t

Re: incorrect brace expansion when using default values

2006-09-05 Thread Mike Frysinger
On Tuesday 05 September 2006 19:01, Paul Jarc wrote: > 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 ex

Re: incorrect brace expansion when using default values

2006-09-05 Thread Paul Jarc
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 param

incorrect brace expansion when using default values

2006-09-05 Thread Mike Frysinger
this little bit of code doesnt work right: foo() { echo "${1:-a{b,c}}" ; } $ foo a{b,c} $ foo 1 a} tested with bash-3.1.17 -mike pgp0Oi7rbI6UV.pgp Description: PGP signature ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listi