From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1399 invoked by alias); 18 Oct 2011 04:19:49 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16505 Received: (qmail 25609 invoked from network); 18 Oct 2011 04:19:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201107; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=syW6fVpjny8Co/P8Ok66RWcdI2gtLX6MvUN0CEq3CMs=; b=dlLSMnEtYG3BNRMlsqSRet1+CJtizo69qf+H5pjcZGkyWKibUkTvjCRR9yLWfEfZD7OI/4BrR3LNrribGfrMQeIfy6rizUExdRb1bhIfmNtFcniUw6xXgGC7qi06gzAjedWjlboAUDvZDJf3TIxqRSkApU/YWfYY1f7Dk9wSOQk=; Date: Tue, 18 Oct 2011 00:19:40 -0400 From: Phil Pennock To: "Daniel Serodio (lists)" Cc: Mikael Magnusson , zsh-users@zsh.org Subject: Re: What's wrong with this expression? Message-ID: <20111018041939.GA52377@redoubt.spodhuis.org> Mail-Followup-To: "Daniel Serodio (lists)" , Mikael Magnusson , zsh-users@zsh.org References: <4E9C9997.3050306@mandic.com.br> <4E9C9DB4.50104@mandic.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E9C9DB4.50104@mandic.com.br> 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. 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 =~ operator. 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".