Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] quoting within bracket patterns has no effect
- X-seq: zsh-workers 37690
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: [BUG] quoting within bracket patterns has no effect
- Date: Tue, 19 Jan 2016 17:25:58 +0100
- Cc: "Zsh Hackers' List" <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=0EcGM6WtZ5o4WFt/HIS+GknaGtrP1Bew9k67sbGHjqY=; b=ZXw7U88Kekqblt/NlYl7AhuTfakSLpNNvgZpHQLBDJGmVfH2tJvpepw0Lcsh+wZXgm ga+zmJGlV3Y4RTLQm2t9Q3P4L0bOuN0wJwohQ0JorEgdN0fgIVtT4RXfjC7SSq9U7tVD 89ZiswMxZ3hQAx97Y2JLDm7TpLwHgyxCrXoYfNyHZRH3OoQcRsfQaL1qY5knbHn13w8D jEDr7Rc+L16I5uX43LVXsMEpNv9NUnpY4IJIQhK3/uj82xrnyZqTTZetrYmdhZ5W8q4y /v/M3bQFU2Jx0HY9qtAxnH2E083aAp3ibQDWoixANgwoB4isFLsve3ZysqmMk8z9dK5b +4kQ==
- In-reply-to: <20160119160344.001b4d2a@pwslap01u.europe.root.pri>
- 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: <569C68AB.2010806@inlv.org> <20160118172434.2fb7d5b9@pwslap01u.europe.root.pri> <20160119160344.001b4d2a@pwslap01u.europe.root.pri>
On Tue, Jan 19, 2016 at 5:03 PM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> diff --git a/README b/README
> index 2e2ebce..8ec148e 100644
> --- a/README
> +++ b/README
> @@ -29,17 +29,43 @@ Zsh is a shell with lots of features. For a list of some of these, see the
> file FEATURES, and for the latest changes see NEWS. For more
> details, see the documentation.
>
> -Incompatibilities between 5.1 and 5.2
> +Incompatibilities between 5.2 and 5.3
> -------------------------------------
>
> +In character classes delimited by "[" and "]" within patterns, whether
> +used for filename generation (globbing) or other forms of pattern
> +matching, it used not to be possible to quote "-" when used for a range,
> +or "^" and "!" when used for negating a character set. The chracters can
> +now be quoted by any of the standard shell means, but note that
> +the "[" and "]" must not be quoted. For example,
> +
> + [[ $a = ['a-z'] ]]
> +
> +matches if the variable a contains just one of the characters "a", "-"
> +or "z" only. Previously this would have matched any lower case ASCII
> +letter. Note therefore the useful fact that
> +
> + [[ $a = ["$cset"] ]]
> +
> +matches any chracter contained in the variable "cset". A consequence
> +of this change is that variables that should have active ranges need
> +(with default zsh options) to be indicated explicitly, e.g.
> +
> + cset="a-z"
> + [[ b = [${~cset}] ]]
> +
> +The "~" causes the "-" character to be active. In sh emulation the
> +"~" is unncessary in this example and double quotes must be used to
> +suppress the range behaviour of the "-".
Does this mean [$cset] and ["$cset"] work the same way in zsh
emulation, and [$cset] and [$~cset] work the same in sh emulation?
(character is also somewhat consistently typoed as chracters in two or
three places).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author