From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4336 invoked by alias); 17 Oct 2011 21:37:54 -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: 16502 Received: (qmail 6279 invoked from network); 17 Oct 2011 21:37:53 -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=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.mandic.com.br designates 200.225.81.143 as permitted sender) Message-ID: <4E9C9E99.7000208@mandic.com.br> Date: Mon, 17 Oct 2011 19:31:05 -0200 From: "Daniel Serodio (lists)" User-Agent: Postbox 2.5.3 (Macintosh/20110907) MIME-Version: 1.0 To: Mikael Magnusson CC: zsh-users@zsh.org Subject: Re: What's wrong with this expression? References: <4E9C9997.3050306@mandic.com.br> <4E9C9DB4.50104@mandic.com.br> In-Reply-To: Content-Type: multipart/alternative; boundary="------------020104090206040006010004" --------------020104090206040006010004 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mikael Magnusson wrote: > On 17 October 2011 23:27, Daniel Serodio (lists) > wrote: >> Mikael Magnusson wrote: >> >> On 17 October 2011 23:09, Daniel Serodio (lists) >> wrote: >> >> I'm trying to troubleshoot a script that works with bash but fails with zsh, >> and it uses the "regex match" operator. What's wrong with this expression? >> >> [[ "foo" ~= "x" ]]&& echo true >> >> Fails with "zsh: condition expected: ~=" >> >> You wrote ~= instead of =~ >> >> Ooops. Error copy'n'pasting. The actual line in the script that fails is: >> >> if [[ ! "${PATH}" =~ $regex ]] ; then >> >> where "regexp" is: >> >> regex="^([^:]*:)*${rvm_bin_path}(:[^:]*)*$" > > Fails how? > Sorry. Fails with "condition expected: =~" --------------020104090206040006010004--