Bug 243500 - bash misinterprets [A-Z]
Summary: bash misinterprets [A-Z]
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash   
(Show other bugs)
Version: 7
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-09 07:51 UTC by Marek Greško
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

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


Attachments (Terms of Use)

Description Marek Greško 2007-06-09 07:51:21 UTC
Description of problem:


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

bash-3.2-9.fc7

How reproducible:

Always.

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 10:40:55 UTC
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:
AaBbC

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 09:39:43 UTC
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 09:42:12 UTC
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 11:54:15 UTC
# echo $LANG
sk_SK.UTF-8
# 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.