Re: [dev] [sbase] [PATCH-UPDATE] Rewrite tr(1) in a sane way

From: Dimitris Papastamos <sin_AT_2f30.org>
Date: Sun, 11 Jan 2015 01:43:37 +0000

On Sat, Jan 10, 2015 at 11:19:20PM +0100, Dmitrij D. Czarkoff wrote:
> FRIGN said:
> > On Sat, 10 Jan 2015 02:52:09 +0100
> > "Dmitrij D. Czarkoff" <czarkoff_AT_gmail.com> wrote:
> >
> > > > +#define UPPER "A-Z"
> > > > +#define LOWER "a-z"
> > > > +#define PUNCT "!\"#$%&'()*+,-./:;<=>?_AT_[\\]^_`{|}~"
> > >
> > > These definitions hugely misrepresent corresponding character classes.
> >
> > I interpreted the character classes by default for the C locale. What do
> > you mean by hugely misrepresenting? They are just fragments to build the
> > classes later on.
>
> No, you interpret the character classes for the C locale only, not just
> by default. Character classes are useless for C locale ("A-Z" is easier
> to type then "[:upper:]" anyway); they only really make sense for
> scripts that are supposed to do The Right Thing™ for every locale.
> Also, defining ranges on systems with no locale-aware collation rules
> may be tricky.

This allows some idiotic scripts to work without editing them. It
does not work correctly in the general case so the limitation should be
documented in the man page.
Received on Sun Jan 11 2015 - 02:43:37 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 11 2015 - 02:48:07 CET