zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-users@zsh.org
Subject: Re: RFE: Brace expansion with single characters
Date: Wed, 08 Jan 2014 11:25:04 +0000	[thread overview]
Message-ID: <20140108112504.76c17284@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAGAAoy08VT4PuRVYy2SYDrCan59JNHJV-ZqBARPxX2wqxjH_6A@mail.gmail.com>

On Wed, 08 Jan 2014 10:55:05 +0100
Jerry Rocteur <jerry.rocteur@gmail.com> wrote:
> echo {0..12}
> 
> Does what is expected
> 
> echo {a..z}
> 
> Does nothing as expected
> 
> setopt braceccl
> echo {a-z}
> 
> does something somebody expected ?

Yes, that's how zsh works; OK so far...

> Shouldn't there be some kind of uniformity or is this for a reason ?

I'm not sure what you mean.  Bash and zsh have different extensions.
Are you saying "should they have the same set of extensions"?  Not
particularly, no.  They copy each other to some extent but also go
their own way to some exstent.  The history is something like:

- zsh invented the BRACECCL option (this has been there for donkey's
years) which expands everything in the brace as a single character (even
if the character is repeated in the base), except that "-" is a special
case to indicate a range.  This is rather different from the feature
required --- it makes braces without commas do rather more than you
expect, as noted by Vincent.   That's not a bug, however; its
significant additional effect is why it's an option.

- zsh invented the {<integer>..<integer>} syntax (vaguely inspired by
Perl).  This isn't an option because it's specific enough not to cause
problems.

- bash also started using that syntax, but added the extra feature
with single character ranges.

> The other two shells work as expected.

As far as I can see, and as your comments at the top suggest, everything
works as expected.  Are you saying both bash and zsh currently work as
documented?  I think that's correct.  The original post was simply a
request for a new feature.

It looks fairly straightforward to add the bash feature to zsh in this
case and I've just been looking at it.  I would imagine this will fit
in naturally enough not to cause complications.

pws


  reply	other threads:[~2014-01-08 11:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 21:49 Daniel Serodio
2014-01-07 23:11 ` Simon Ruderich
2014-01-08  9:22   ` Vincent Lefevre
2014-01-08  9:55   ` Jerry Rocteur
2014-01-08 11:25     ` Peter Stephenson [this message]
2014-01-08 12:13 ` Peter Stephenson

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=20140108112504.76c17284@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@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).