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

Re: incorrect brace expansion

2006-01-29 Thread Chet Ramey
William Park wrote: >> side note, this also fails: >> $ echo {a}{b,c} >> {a}{b,c} >> -mike > > But, > echo {b,c}{x} > prints the correct result, > b{x} c{x} > > Well, gentlemen, we've found a bug. Anyone sending in a patch? I don't > use multiple braces that often, so it doesn't bother

Re: incorrect brace expansion

2006-01-29 Thread William Park
On Sun, Jan 29, 2006 at 08:16:40PM -0500, Mike Frysinger wrote: > On Sunday 29 January 2006 20:08, William Park wrote: > > On Sun, Jan 29, 2006 at 07:33:14PM -0500, Chris F.A. Johnson wrote: > > > On Sun, 29 Jan 2006, William Park wrote: > > > >Let's see... > > > > a-{b{d,e}}-c > > > > a-{bd,be

Re: incorrect brace expansion

2006-01-29 Thread Mike Frysinger
On Sunday 29 January 2006 20:08, William Park wrote: > On Sun, Jan 29, 2006 at 07:33:14PM -0500, Chris F.A. Johnson wrote: > > On Sun, 29 Jan 2006, William Park wrote: > > >Let's see... > > > a-{b{d,e}}-c > > > a-{bd,be}-c > > > a-bd-c a-be-c > > > > > >It looks okey, I think. > > > > Exc

Re: incorrect brace expansion

2006-01-29 Thread William Park
On Sun, Jan 29, 2006 at 07:35:32PM -0500, Mike Frysinger wrote: > On Sunday 29 January 2006 19:23, William Park wrote: > > Let's see... > > a-{b{d,e}}-c > > a-{bd,be}-c > > i'm pretty sure the commas are consumed in the expansion > > side note, this also fails: > $ echo {a}{b,c} > {a}{b,c

Re: incorrect brace expansion

2006-01-29 Thread William Park
On Sun, Jan 29, 2006 at 07:33:14PM -0500, Chris F.A. Johnson wrote: > On Sun, 29 Jan 2006, William Park wrote: > >Let's see... > > a-{b{d,e}}-c > > a-{bd,be}-c > > a-bd-c a-be-c > > > >It looks okey, I think. > > Except that b{d,e} expands to 'bd be', not 'bd,be'. Hmm... no. Internally

Re: incorrect brace expansion

2006-01-29 Thread Mike Frysinger
On Sunday 29 January 2006 19:23, William Park wrote: > Let's see... > a-{b{d,e}}-c > a-{bd,be}-c i'm pretty sure the commas are consumed in the expansion side note, this also fails: $ echo {a}{b,c} {a}{b,c} -mike ___ Bug-bash mailing list Bug-

Re: incorrect brace expansion

2006-01-29 Thread Chris F.A. Johnson
On Sun, 29 Jan 2006, William Park wrote: On Sun, Jan 29, 2006 at 05:37:56PM -0500, Mike Frysinger wrote: On Sunday 29 January 2006 17:25, Bob Proulx wrote: The bash manual documents this as "Patterns to be brace expanded take the form of an optional PREAMBLE, followed by either a series of com

Re: incorrect brace expansion

2006-01-29 Thread William Park
On Sun, Jan 29, 2006 at 05:37:56PM -0500, Mike Frysinger wrote: > On Sunday 29 January 2006 17:25, Bob Proulx wrote: > > The bash manual documents this as "Patterns to be brace expanded > > take the form of an optional PREAMBLE, followed by either a series > > of comma-separated strings or a sequnc

Re: incorrect brace expansion

2006-01-29 Thread Mike Frysinger
On Sunday 29 January 2006 17:25, Bob Proulx wrote: > The bash manual documents this as "Patterns to be brace expanded take > the form of an optional PREAMBLE, followed by either a series of > comma-separated strings or a sequnce expression between a pair of > braces, followed by an optional POSTSCR

Re: incorrect brace expansion

2006-01-29 Thread Bob Proulx
Mike Frysinger wrote: > bash -c 'echo a-{b}-c' > a-{b}-c > > seems to me current behavior is inconsistent Yes. That is inconsistent with csh. csh -c 'echo a-{b}-c' a-b-c It is related to brace expansion but seems like a different case than the original poster's bug report. In the origina

Re: incorrect brace expansion

2006-01-29 Thread Bob Proulx
Tim Waugh wrote: > echo a-{b{d,e}}-c > > Should get: a-{bd}-c a-{be}-c > but actually get: a-bd-c a-be-c Hmm... But csh is the origin of the brace expansion feature. So shouldn't bash behave like csh? Which bash does do at this time. csh -c 'echo a-{b{d,e}}-c' a-bd-c a-b

Re: incorrect brace expansion

2006-01-29 Thread Mike Frysinger
On Saturday 28 January 2006 16:47, Bob Proulx wrote: > Tim Waugh wrote: > > echo a-{b{d,e}}-c > > > > Should get: a-{bd}-c a-{be}-c > > but actually get: a-bd-c a-be-c > > Hmm... But csh is the origin of the brace expansion feature. So > shouldn't bash behave like csh? Which bash doe

incorrect brace expansion

2006-01-28 Thread Tim Waugh
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: i386-redhat-linux-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/s