When did linux become caseless?

Smylers Smylers at stripey.com
Fri Jun 15 11:33:20 BST 2007


Dirk Koopman writes:

> Just did "rm [A-Z]*" and had a load of files with lower case first
> letters removed as well.

It isn't that Bash is caseless.  You can prove that to yourself by
checking that A* and a* still match different files.

The issue here is that it's localized.  You're apparently running in a
locale in which the localized colating order is:

  AaBbCc ... Zz

(in which case you should find that any files beginning with a
lower-case "z" survived the removal).  Or possibly you're in a locale
with:

  aAbBcD ... zZ

(in which case z* files will have gone, but a* files survived).

> I am guessing that this some bash argument expansion option.

Not specific to Bash; any program that sorts text should take
$LC_COLLATE into account.  Or if $LC_COLLATE isn't set, the more generic
$LANG is used instead.

> Any ideas as to how to get the correct behaviour?

Doing this will specify collating letters in Ascii order:

  export LC_COLLATE=C

Smylers


More information about the london.pm mailing list