> It's worth noting here that bash's globbing of '[A-Z]*' etc is
> definitely different from the system collation sequence (i.e. using
> fnmatch() or glob() functions). There is an open bug report about this
> here:
On the contrary, the bash globbing of [A-Z] is using exactly the system's
collating sequence. Bash uses strcoll; glibc/python probably use character
value comparisons for old-style bracket range expressions.
Running the attached program like
asort -v {a..z} {A..Z}
will give you the current locale and show how the arguments sort. I get
$ ./asort -v {a..z} {A..Z}
default locale = en_US.UTF-8
a A b B c C d D e E f F g G h H i I j J k K l L m M n N o O p P q Q r R s S t T
u U v V w W x X y Y z Z
$ LC_ALL=en_US ./asort {a..z} {A..Z}
a A b B c C d D e E f F g G h H i I j J k K l L m M n N o O p P q Q r R s S t T
u U v V w W x X y Y z Z
This shows the collating sequence for alphabetics in the en_US locale. (Since
I don't set LC_ALL anywhere in my startup files, my system's default locale is
apparently en_US.UTF-8.)
Chet