[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nocaseglob

From: Chet Ramey
Subject: Re: nocaseglob
Date: Tue, 23 Jan 2007 10:10:31 -0500

> 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.)


Attachment: asort.c
Description: Text document

``The lyf so short, the craft so long to lerne.'' - Chaucer
                                Live Strong.
Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.case.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]