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

Re: zsh handling of non-standard if-evaluations



Daniel Qarras wrote:
> --- Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > schaefer[501] [ "$VAR" == "VAL" ]; echo $?
> > zsh: = not found
> > schaefer[502] setopt no_equals
> > schaefer[503] [ "$VAR" == "VAL" ]; echo $?
> > 1
> 
> Correct.

Note that "setopt nonomatch" is enough to get this to work; that allows
you to carry on using =-expansion (that's why I didn't find the problem
to begin with).  It even works if you have a programme called = in your
path.

(That seems a little strange, actually.  Either you'd expect == to find
a programme called =, or you'd expect == to be a normal argument without
any pattern match failure.  It seems that you need to quote the second
argument: =\= does find = in the path.  That strikes me as a bug.)

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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