bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incorrect brace expansion


From: Bob Proulx
Subject: Re: incorrect brace expansion
Date: Sun, 29 Jan 2006 15:25:30 -0700
User-agent: Mutt/1.5.9i

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 poster's case they
wanted the to see the braces output but here your exampld is a case
where they are being output and yet they should not be.

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."  Your example did not
have either comma-separated strings nor a sequence and therefore does
not qualify for brace expansion and should have been left verbatim.
And yet bash did brace expansion anyway.  That is an inconsistency.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]