Comment 4 for bug 571958

Revision history for this message
Gabe Gorelick (gabegorelick) wrote : Re: bash always globs case-insensitively

This link [1] provides some good info on this. A quote from the bash manual found at that link explains the issue:

"Within a bracket expression, a range expression consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, inclusive, using the locale's collating sequence and character set. For example, in the default C locale, "[a-d]" is equivalent to "[abcd]". Many locales sort characters in dictionary order, and in these locales "[a-d]" is typically not equivalent to "[abcd]"; it might be equivalent to "[aBbCcDd]", for example. To obtain the traditional interpretation of bracket expressions, you can use the C locale by setting the LC_ALL environment variable to the value "C""

So if you export LC_ALL=C, then the globbing should work. Can you confirm that this solves the problem for you? I just checked and it works for me.

As a footnote, apparently the Single Unix Specification version 3 advises against using range expressions, so they really shouldn't be used if you can avoid it since they run into problems like this with locales.

[1] http://bugs.centos.org/view.php?id=1511