Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: What's wrong with this expression?
- X-seq: zsh-users 16501
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: "Daniel Serodio (lists)" <daniel.lists@xxxxxxxxxxxxx>
- Subject: Re: What's wrong with this expression?
- Date: Mon, 17 Oct 2011 23:30:12 +0200
- Cc: zsh-users@xxxxxxx
- 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=
- In-reply-to: <4E9C9DB4.50104@mandic.com.br>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4E9C9997.3050306@mandic.com.br> <CAHYJk3Qm8NP_ofAA=9FVhjFHTC+Ay4n5SO0X69gzKV94EjsRfw@mail.gmail.com> <4E9C9DB4.50104@mandic.com.br>
On 17 October 2011 23:27, Daniel Serodio (lists)
<daniel.lists@xxxxxxxxxxxxx> wrote:
> Mikael Magnusson wrote:
>
> On 17 October 2011 23:09, Daniel Serodio (lists)
> <daniel.lists@xxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author