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

Re: What's wrong with this expression?

Phil Pennock wrote:
On 2011-10-17 at 19:27 -0200, Daniel Serodio (lists) wrote:
Mikael Magnusson wrote:
On 17 October 2011 23:09, Daniel Serodio (lists)
     [[ "foo" ~= "x" ]]&&   echo true

Ooops. Error copy'n'pasting. The actual line in the script that fails is:

      if [[ ! "${PATH}" =~ $regex ]] ; then

See, this is why reporting the _actual_ code which causes an error
helps; or, if you want to simplify, at least test that the failure still
happens with the simplified version.
Mea culpa indeed. I tried to simplify the problem but ended up complicating it.
This was a bug, fixed on 2010-10-10 and the fix included in the release
of zsh 4.3.11.  The current version of zsh is 4.3.12.  Negated patterns
and tests combined with&&/|| failed prior to that when using the =~

If you are running 4.3.11 or newer, please state which version you're
using and preferably show the minimum needed to reproduce, starting from
"zsh -f".
Thanks a lot. This computer is running zsh 4.2.6, I'll try to have it updated.

Daniel Serodio

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