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 shouldn't it

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 of the

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 work right: foo() {

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 PROTECTED] wrote:

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 the braces

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, EXPANSION).

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 expansion happens before

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 parameter

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 original

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 POSTSCRIPT.

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 sequnce

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

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

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, {d,e} gets

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. Except that b{d,e} expands

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 me. :-) Don't