Bug 243500 - bash misinterprets [A-Z]
bash misinterprets [A-Z]
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2007-06-09 03:51 EDT by Marek Greško
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-10 06:40:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marek Greško 2007-06-09 03:51:21 EDT
Description of problem:

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. mkdir test; cd test
2. touch A a M m S s Z z
3. echo [A-Z]
Actual results:
A a M m S s Z

Expected results:
A a M m S s Z z for national locale.
A M S Z for locale C.

Additional info:
Problem applies to any other character range and also for lowercase. But for
lowercase in oposit:
echo [a-z] results in a M m S s Z z (the first character is missing).
Comment 1 Hans de Goede 2007-06-10 06:40:55 EDT
This is not a bug, if you want A-Z and a-z with a nationale local you should use
A-z. with a nationale (not C) LC_COLLATE, A-C for example correctly expands to:

this is to be expected, of you also want to have the lowercase of the end of the
range included, end with the lowercase: [A-c] or [A-z]

Closing as not a bug, if you disagree please explain why and reopen.
Comment 2 Marek Greško 2007-06-11 05:39:43 EDT
Aha. There is another problem. When I used to unset the LANG variable (and any
of LC_* where not set) the default locale was C. Now, the default locale is
something another. When I explicitly set LC_COLLATE (or LANG) to C. The behavior
is as expected.
Comment 3 Hans de Goede 2007-06-11 05:42:12 EDT
Are you sure you have properly unset LANG and if you define that LC_ALL,
unsetting LANG gives the C collate behaviour for me.
Comment 4 Marek Greško 2007-06-11 07:54:15 EDT
# echo $LANG
# unset LANG
# export LANG
# echo $LANG

# set | grep LC_
# echo [A-Z]
A a M m S s Z

Note You need to log in before you can comment on or make changes to this bug.