[Top][All Lists]

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

Re: filename expansion with [a-z] matches upper case

From: Bob Proulx
Subject: Re: filename expansion with [a-z] matches upper case
Date: Sun, 1 Apr 2007 01:21:46 -0600
User-agent: Mutt/1.5.9i

address@hidden wrote:
>       The expansion of the filename pattern "*.[a-z]* matches files with
>       upper case after the period, not just lower case, even though the 
>       "nocaseglob" is set to off, when the LANG variable is set to
>       "en_US.UTF-8".

Yes.  What you are seeing is not a bug in bash but is a configuration
selected by the LANG=en_US.UTF-8 locale setting.  When that locale is
in effect the collation order is [aAbBcC...zZ] therefore when you
specify [a-z] you are getting [aAbBcC...z] all of the lower case
letters plus almost all of the upper case letters minus the Z.

This not only affects bash but all system utilities that use the
locale sort ordering.  You will see this with ls, sort, grep, etc.

My personal setting is the following.  This selects a UTF-8 locale in
general but overrides the collation sequence to specify a POSIX
standard sort ordering.  YMMV.

  export LANG=en_US.UTF-8
  export LC_COLLATE=C


reply via email to

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