Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible bug in OR evaluation in zsh 4.3.10
- X-seq: zsh-workers 32713
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Hamilton Turner <hamiltont@xxxxxxxxx>
- Subject: Re: Possible bug in OR evaluation in zsh 4.3.10
- Date: Thu, 5 Jun 2014 12:42:09 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=t1DiEi0yJ6ua6Z+U+OspB5EGvJOz1ArLHLzjosqgYT4=; b=cbItA8DO0hMdCG+DL4nFrqkbqDyr0ZtXZ3kGmVrsh67J7E460b/A476Az8yO/QOM+a Qb3g0MU7Y4MZjvYTYMXehM/0dWvmpG1BGJ48rVdrNT/d7ZM+SrGZXi8Vg53c3ZPPSL7j l0QYxbN3Ay+vqSzxSVKnpxcl1+9lm82mFWK9xbIcTW9B1R5RqMchKirVupkULIj3ISob hFJ/ZAktFDkP/4jLDaPBvFCBzvLaCDjBcBflr2RWLg3cocj55SJmDBsnMLV0oZH3HsAu 7NAj4Uvxsm0S0rOjAD3bL9TAFq8iRnzxYzj5OFD4af9Xs38UGS016YuU3AgoDC2ZYNYO QgNA==
- In-reply-to: <CAFow3A-9czw1OU+P1_go_xswFW92DKizv2GnS-OzAhY6FQ-CLQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAFow3A-9czw1OU+P1_go_xswFW92DKizv2GnS-OzAhY6FQ-CLQ@mail.gmail.com>
On 5 June 2014 08:18, Hamilton Turner <hamiltont@xxxxxxxxx> wrote:
> I'm experiencing this unexpected behavior:
>
> $ if [[ "foo" =~ "^\s*$" ]]; then; echo "Test"; fi
>> $ if [[ "foo" =~ "^\.+$" ]]; then; echo "Test"; fi
>> $ if [[ "foo" =~ "^\.+$" || "foo" =~ "^\s*$" ]]; then; echo "OR test"; fi
>> OR test
>
>
> Now my shell scripting is definitely not superb, but this seems to be
> incorrect - I would expect that
> none of the if conditions trigger an echo. Assuming that my expectation is
> correct, here's what I
> know:
>
> na: zsh 4.2.1 on Solaris 10 (no =~ operator)
> fail: zsh 4.3.10 on CentOS 6
> fail: zsh 4.3.10 on RH 6.3 and 6.5
> ok; 4.3.17 on Solaris 11
> ok: 4.3.17 on Ubuntu 12.04
> ok: zsh 5.0.2 on Ubuntu 14.04
> ok: zsh 5.0.2 on OS X
> ok: zsh 5.0.2 on CentOS 6
>
> (Thanks a ton to boyd from #zsh for help on different systems)
Yes, this is a bug that has been fixed. IIRC, -regex-match always
works correctly, only the =~ operator didn't, if you do need scripts
to run on broken zsh versions.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author