Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: (#m) and "case" alternation
- X-seq: zsh-workers 33675
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: (#m) and "case" alternation
- Date: Tue, 11 Nov 2014 14:23:56 +0100
- 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 :content-type; bh=jd9JvbcRWN6fj/vEOuTqSBhUUdiJ+8G5GBnp4r+tKxM=; b=LUbQbmexv9MKMt9d3ghr3ThjoH2be/XOj/ZXm0nCTUaBLfi6VYZUUzS5GPRzvzfufn pwp0/0abGmWW+tdTPEcADQq2nUediB+9oPzXrKNlMZlhsAtllCLIOWQ9cCGdrOq9mJsE NgPvT5//kza+QyXdU8nfqZrrSBv5XxiSj+Y8DRgCTKzuiRYeIsdjXY2C7QEbp+kjW+Li Fx9t5WeFt+EwqeYwv/VDyAsVONd1Im74ULV4BdsTtShWfLDkfX1QHlj7z5WnmIvd/oW9 Z4i85EKqHB27emGQziILkbmzDDv2zWMdAzx7mlX2lUVHoirNwzCzB1IJJNmfdzdKaS+y 6cJA==
- In-reply-to: <20141111125423.GA4343@chaz.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: <20141111125423.GA4343@chaz.gmail.com>
On Tue, Nov 11, 2014 at 1:54 PM, Stephane Chazelas
<stephane.chazelas@xxxxxxxxx> wrote:
> Hello.
>
> Some unexpected behaviour:
>
> $ case abc in ((#m)a* | b*) echo $MATCH; esac
>
> $ case abc in ((#m)a* | (#m)b*) echo $MATCH; esac
> abc
> $ case abc in (a* | (#m)b*) echo $MATCH; esac
> abc
> $ case bcd in ((#m)a* | b*) echo $MATCH; esac
> bcd
I don't get "bcd" output for the last of these. Also a note to people
reproducing this, make sure to unset MATCH between each command; if
you run the second one and then the first one you'll get abc output
for both.
> (#b) is OK:
>
> $ case abc in (#b)(a)* | (#b)(b)*) echo $match; esac
> a
> $ case bcd in (#b)(a)* | (#b)(b)*) echo $match; esac
> b
> $ case abc in (#b)(a)* | (#b)(ab)*) echo $match; esac
> a
> $ case abc in (#b)(ab)* | (#b)(a)*) echo $match; esac
> ab
> $ case bcd in (#b)(ab)* | (b)*) echo $match; esac
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author