Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 'case' pattern matching bug with bracket expressions
On 5/14/15 1:43 PM, Peter Stephenson wrote:
> This is hairy because you're relying on whitespace performing word
> splitting in a case where you don't need whitespace according to the
> grammar anyway, i.e. if you have the valid expression
>
> case abc in (["$empty"]|[!a-z]*) echo yes ;; (*) echo no ;; esac
>
> it can only be parsed the way zsh parses it --- you'll find bash does
> the same.
The `|' delimits the token; `["$empty"]' is a single WORD. Both shells
effectively parse this the same way.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@xxxxxxxx http://cnswww.cns.cwru.edu/~chet/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author