From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18426 invoked by alias); 17 Oct 2011 21:35:44 -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: 16501 Received: (qmail 7217 invoked from network); 17 Oct 2011 21:35:42 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=niIWvoFNOVt90EQxYTf0LnLX8xKvBEc2qB+szohPLuE=; b=bjsR3myhezF4Z+6cHMNZcKpFb5cY6DqDoArmMlrjea42K4AYF/EjRRQAVdf6BAGqUz 2v5zHbudZezr9agQ0TExErdKobr3PzzBbUzXNuyB2KObxxMxOK6EWcO+stHuX9qdQSml JnT7bL6SoAxBhasNbzqpKLYN1sSnQnkF1QkH8= MIME-Version: 1.0 In-Reply-To: <4E9C9DB4.50104@mandic.com.br> References: <4E9C9997.3050306@mandic.com.br> <4E9C9DB4.50104@mandic.com.br> Date: Mon, 17 Oct 2011 23:30:12 +0200 Message-ID: Subject: Re: What's wrong with this expression? From: Mikael Magnusson To: "Daniel Serodio (lists)" Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 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? -- Mikael Magnusson