bug-fileutils
[Top][All Lists]
Advanced

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

bash-2.03 and 2.05-beta vs. globbing with LC_COLLATE != C


From: Jim Meyering
Subject: bash-2.03 and 2.05-beta vs. globbing with LC_COLLATE != C
Date: 10 Mar 2001 04:57:14 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.99

Thanks for the report.
I'm confident it's not a bug in rm.
It looks like it's a *feature* (albeit confusing) of your shell,
which is probably bash-2.03 or a test release of bash-2.05.

It looks like bash-2.05 (when it is released) will be like 2.03:

  [this is using bash-2.05-beta1 on a solaris5.8 system]
  $ export LC_COLLATE=en_US
  $ echo [a-z]*
  a B b C c
  $ export LC_COLLATE=C
  $ echo [a-z]*
  a b c

>From bash-2.05-beta1's CHANGES file:

  c.  The globbing library once again respects locales when processing ranges
      in bracket expressions while doing pattern matching.

So it looks like this was `fixed' in 2.04, but then reverted to
the original (presumably better-in-the-long-run) behavior for 2.05.
I've had a very similar battle with GNU sort.  If you use the wrong
locale (e.g., en_US), newer versions of GNU sort give results that
are very different from those most people are used to.

The solution is to encourage people to put this in the appropriate
shell start-up file.

  export LC_COLLATE=C # for bash

  setenv LC_COLLATE C # for C-shells

Or, just set LANG or LC_ALL.

Jim


Mike Busse <address@hidden> wrote:
| First off I'd like to say thanks for the hard developement work!
|
| I just found what I believe is a bug, here's the details:
|
| Summary: Trying to use rm to do remove all lowercase lettered filenames.
|
|
| expedition /src/X11/bin/expect5.32/obj/sol2.8 284 # ls
| Config        config.log     expect_cf.h  pkgIndex  tcldbgcf.h
| config.cache  config.status  Makefile     shared    testsuite
| expedition /src/X11/bin/expect5.32/obj/sol2.8 285 # rm -rf [a-z]* .[a-z]*
| expedition /src/X11/bin/expect5.32/obj/sol2.8 286 # ls
| expedition /src/X11/bin/expect5.32/obj/sol2.8 287 # ls
| expedition /src/X11/bin/expect5.32/obj/sol2.8 288 #
| expedition /src/X11/bin/expect5.32/obj/sol2.8 288 # ls
| expedition /src/X11/bin/expect5.32/obj/sol2.8 289 # ls -al
| total 2
| drwxr-xr-x    2 root     other        1024 Mar  2 13:32 .
| drwxr-xr-x    3 root     other         512 Mar  1 18:37 ..
| expedition /src/X11/bin/expect5.32/obj/sol2.8 290 # touch A B C a b c
| expedition /src/X11/bin/expect5.32/obj/sol2.8 291 # rm -rf [a-z]* .[a-z]*
| expedition /src/X11/bin/expect5.32/obj/sol2.8 292 # ls
| A
...



reply via email to

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