[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Output from date command defaults to 12-hour in Buster.



> On Mi, 29 apr 20, 19:18:14, Nicolas George wrote:
> > I live in the rest of the world, and I do NOT want my numbers to have
> > commas in them instead of decimal points, nor do I want [0-9a-f] to
> > match "ça" and "fée".

For the first part, you want LC_NUMERIC=C.

For the second part, what you're asking for is sometimes called
"rational ranges", or "rational range interpretation".  This is the
notion that, for specific range expressions like '[a-z]' within a
regular expression or glob, the software will assume you want to
match only '[[:lower:]]', rather than doing what you actually said.

The idea behind this is based on the (probably accurate) belief that
most people who write [a-z] or [A-Z] in their scripts wanted the
LC_COLLATE=C (or 1980s) meaning of the range, not the meaning of the
range in modern times.  Thus, it's a sort of safety net strung below
the novice programmer, to catch them when they fall.

Since this is not how systems currently behave, however, what you need
to do in your script is write the expression correctly.  For your
example, I believe that would be [[:xdigit:]].  Or if you really do
mean to restrict it to lower-case 'a' through 'f', retain what you
have, but set LC_COLLATE=C first.

I haven't seen rational range interpretation discussion that covers
'[a-f]', but I haven't been following it closely.


Reply to: