bug-bash
[Top][All Lists]
Advanced

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

Re: nocaseglob


From: Bruce Korb
Subject: Re: nocaseglob
Date: Mon, 22 Jan 2007 08:04:36 -0800

On 1/22/07, Bob Proulx <address@hidden> wrote:
Unfortunately in this case setting the variable on the command line
for that command won't do what you want.  Since file globbing takes
I figured that out.  :}

  (unset LC_ALL LC_COLLATE LANG ; echo [a-z]*)
  (LC_COLLATE=en_US.UTF-8 ; echo [a-z]*)
  (LC_COLLATE=C ; echo [a-z]*)

$ echo [a-z]*
bin bk-archives Bugzilla core cron Desktop docs [[...]]
$ export LC_COLLATE=C
/home/usr/bkorb
$ echo [a-z]*
bin bk-archives core cron docs [[...]]
$ unset LC_COLLATE
$ echo [a-z]*
bin bk-archives Bugzilla core cron Desktop docs [[...]]
$ echo [a-d]*
bin bk-archives Bugzilla core cron docs
$ echo [a-D]*
bin bk-archives Bugzilla core cron Desktop docs Downloads

OK.  I'm just going to set LC_COLLATE to "C" and not sweat it.
There seems to be something else aside from LC_ALL, LC_COLLATE
and LANG that affects collating sequence.  Notice the difference
between "[a-d]*" and "[a-D]*".  Whatever collating sequence is being used
do select files puts "D" after "d", though the actual sort puts them as being
equal.  Whatever.  I've gotten bored now. :)

I do not see that behavior here.  I am using the stock bash
distributed by Debian.

I get the behavior with the stock RedHat and (likely, though not certain)
stock Debian BASHes.  So, it seems clear: something aside from LANG,
LC_ALL and LC_COLLATE affects the collating sequence.

$ unset LANG LC_COLLATE LC_ALL
$ echo [a-D]*
bin bk-archives Bugzilla core cron Desktop docs Downloads

You might be chasing a patch bug.

Whatever it is, I have the workaround:  LC_COLLATE=C.
Thank you, Bob.

Regards, Bruce




reply via email to

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