Bug 77349
Summary: | case sensitive filename globbing | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Fabrice Bellet <fabrice> |
Component: | bash | Assignee: | Tim Waugh <twaugh> |
Status: | CLOSED NOTABUG | QA Contact: | Ben Levenson <benl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | dan |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2002-11-05 17:31:21 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Fabrice Bellet
2002-11-05 17:24:27 UTC
And 'locale' says? bash-2.05a$ locale LANG=en_US LC_CTYPE="en_US" LC_NUMERIC="en_US" LC_TIME="en_US" LC_COLLATE="en_US" LC_MONETARY="en_US" LC_MESSAGES="en_US" LC_PAPER="en_US" LC_NAME="en_US" LC_ADDRESS="en_US" LC_TELEPHONE="en_US" LC_MEASUREMENT="en_US" LC_IDENTIFICATION="en_US" LC_ALL= It is collating according to en_US rules. You forgot to use 'LANG=C' if you wanted C-locale collation. Setting C-locale didn't change the behaviour : bash-2.05a$ export LANG=C bash-2.05a$ locale LANG=C LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL= bash-2.05a$ touch xx yy ZZ YY bash-2.05a$ shopt -u nocaseglob bash-2.05a$ echo [a-z]* xx yy YY bash-2.05a$ shopt -s nocaseglob bash-2.05a$ echo [a-z]* xx yy YY ZZ bash-2.05a$ ls YY ZZ xx yy I'd say it looks like a boundary problem when globbing [a-z], because if I substitute the filename ZZ with another one in uppercase, strictly included in the a-z range, this filename is globbed, independantly of the value of the 'nocaseglob' option : bash-2.05a$ rm ZZ bash-2.05a$ touch XX bash-2.05a$ shopt -u nocaseglob bash-2.05a$ echo [a-z]* xx XX yy YY bash-2.05a$ shopt -s nocaseglob bash-2.05a$ echo [a-z]* xx XX yy YY bash-2.05a$ ls XX YY xx yy Did I forget something else ? It looks strange and unexpected to me. By the way, [[:upper:]] and [[:lower:]] show me an expected behaviour with the C locale : bash-2.05a$ ls -l total 0 -rw-r--r-- 1 bellet users 0 Nov 5 18:49 XX -rw-r--r-- 1 bellet users 0 Nov 5 18:47 YY -rw-r--r-- 1 bellet users 0 Nov 5 18:47 xx -rw-r--r-- 1 bellet users 0 Nov 5 18:47 yy bash-2.05a$ shopt -s nocaseglob bash-2.05a$ echo [[:lower:]]* xx XX yy YY bash-2.05a$ echo [[:upper:]]* [[:upper:]]* bash-2.05a$ shopt -u nocaseglob bash-2.05a$ echo [[:lower:]]* xx yy bash-2.05a$ echo [[:upper:]]* XX YY Then perhaps you are seeing bug #74701, where changing the LANG shell variable doesn't call setlocale? Try 'LANG=C bash'. Yes, it works in this case. Thanks and sorry for the false alarm :-) *** Bug 182497 has been marked as a duplicate of this bug. *** |