[Bug 256473] FreeBSD shells are case insensitive for character ranges

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 08 Jun 2021 07:52:07 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256473

Stefan Eßer <se@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |se@FreeBSD.org

--- Comment #1 from Stefan Eßer <se@FreeBSD.org> ---
Please check your LANG (and possibly LC_CTYPE) setting.

There are many locales that do not follow the ASCII collating sequence A .. Z
followed by a .. z. Very common is a sequence of: A a B b ... Z z - and that
includes all lower case letters except z within the range [A-Z].

Try with LANG set to "C" whether this gives the expected result.

Shell scripts that depend on a specific collating sequence should always reset
LANG and LC_CTYPE to default values (e.g. LANG=C and LC_CTYPE unset).

Interactive shells should be able to support LC_CTYPE=C to set the collating
sequence independently of LANG, but in my tests this is implemented to
different degrees in different shells.

Some shells do not even respect the collating sequence specified by LANG, and
bash is the one that appears to ignore both LANG and LC_CTYPE and to always use
the ASCII collating sequence (or rather pure bytewise string comparison?).

The tcsh in FreeBSD uses only LANG and ignores LC_CTYPE to select the collating
sequence, btw.

-- 
You are receiving this mail because:
You are the assignee for the bug.