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

Re: Incompatibility when Zsh invoked as 'sh'



"Bart Schaefer" wrote:
> On Feb 4, 12:13am, DervishD wrote:
> }
> }     Well, the error is the '[*' pattern, which zsh says is a 'bat
> } pattern'. Bash treats it as the regex 'match an opening bracket and
> } anything after it', but zsh doesn't.
> 
> Nothing in section 9.3.5 allows for an unmatched left-bracket to match a
> literal bracket.  The description of the "case" construct doesn't make
> any exception to this, either.

I suppose it's those shells' way of getting round the problem of treating a
single `[' as the start of a test without needing it quoted.  Zsh makes an
exception in that single case only; maybe the others make an exception for
any word starting with `['.  I certainly can't see any good reason for
changing.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



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