From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: [BUG] quoting within bracket patterns has no effect
Date: Tue, 19 Jan 2016 17:25:58 +0100 [thread overview]
Message-ID: <CAHYJk3RjfBBKzCSQc48Zx2cF_TxXkzMXybR=RL0503wiWFeq6w@mail.gmail.com> (raw)
In-Reply-To: <20160119160344.001b4d2a@pwslap01u.europe.root.pri>
On Tue, Jan 19, 2016 at 5:03 PM, Peter Stephenson
<p.stephenson@samsung.com> 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
next prev parent reply other threads:[~2016-01-19 16:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 4:23 Martijn Dekker
2016-01-18 17:24 ` Peter Stephenson
2016-01-19 15:57 ` Jun T.
2016-01-19 17:35 ` Peter Stephenson
2016-01-19 18:54 ` Bart Schaefer
2016-01-20 10:48 ` Jun T.
2016-01-20 11:04 ` Peter Stephenson
2016-01-19 16:03 ` Peter Stephenson
2016-01-19 16:25 ` Mikael Magnusson [this message]
2016-01-19 16:34 ` Peter Stephenson
2016-01-19 18:41 ` Bart Schaefer
2016-01-23 0:17 ` Martijn Dekker
2016-01-23 1:49 ` Bart Schaefer
2016-01-26 4:03 ` Martijn Dekker
2016-01-26 4:48 ` Bart Schaefer
2016-01-26 14:07 ` Martijn Dekker
2016-01-27 3:05 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHYJk3RjfBBKzCSQc48Zx2cF_TxXkzMXybR=RL0503wiWFeq6w@mail.gmail.com' \
--to=mikachu@gmail.com \
--cc=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).