Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 'case' pattern matching bug with bracket expressions



On Thu, 14 May 2015 16:55:57 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> It occurs to me that other shells will treat whitespace as ending a
> pattern for syntactic reasons, even if logically it can't:
> 
> [[ ' ' = [ ] ]]
> 
> works in zsh, but is a parse error in bash.

I'm talking nonsense here --- I'm thinking of parentheses (which have
always been subtle because of zsh's pattern syntax and work differently
in POSIX mode anyway).  A space after a square bracket *does* split the
word.

Otherwise we wouldn't know whether "[ " at the start of the line was a
test command or the start of a group.

I don't think changing the case parsing to do proper words is *that*
difficult --- it's always been a bit of a hack, so could do with
being fixed.

pws



Messages sorted by: Reverse Date, Date, Thread, Author