Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: OT: Bash 3.0 Released



Oliver Kiddle wrote:
> Stephane Chazelas wrote:
> 
> > Interesting feature not in zsh (AFAIK) :
> > 
> > {a..d} for {a,b,c,d}
> 
> setopt braceccl
> echo {a-d}
> 
> I'm not sure the bash syntax isn't better though...

Yes, it would be.  This is all ancient history.  Bart will no doubt
find some ancient email or change entry to contradict me, but it went
something like this:

- pfalstad original had just BRACE_CCL.  The main reason this is an
  option rather than default behaviour is you can also do {aeiou} to
  generate any of the characters in the same way as {a,e,i,o,u}.
  (Bart told me for the purpose of the book that BRACE_CCL stands
  for `brace character classes', so it's deliberately similar to
  the way [aeiou] works in pattern matching.)

- I added the {num1..num2} syntax, borrowed from Perl.  Braces without
  commas don't usually have any effect, so I wasn't too worried about
  compatibility.  But to be on the safe side I made sure it fitted
  the form exactly.

- Bash borrowed {num1..num2}, although without the feature to pad
  leading zeroes.

- They've obviously decided to extend this to characters in a consistent
  way.

Borrowing it back is presumably not that hard, but I'm doubtful how
useful it would be.  It's in the sort of area where no one is going
to expect much compatibility between shells.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author