bug-coreutils
[Top][All Lists]
Advanced

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

Collating order


From: Ole Laursen
Subject: Collating order
Date: 05 Apr 2005 12:11:28 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Hi,

Apparently, the way ls sort the file names does not work with a
localised sorting order. For instance, with a en_US locale, I get:

  ~$ mkdir t && cd t
  ~/t$ touch event.C event.h eventgenerator.C eventgenerator.h
  ~/t$ LANG=en_US ls -1
  event.C
  eventgenerator.C
  eventgenerator.h
  event.h
  ~/t$ LANG=C ls -1
  event.C
  event.h
  eventgenerator.C
  eventgenerator.h
  ~/t$ ls --version
  ls (coreutils) 5.2.1

I would expect the behaviour of the LANG=C locale. According to a
knowledgeable guy on the libc-locales mailing list, the behaviour is a
feature of the localised sorting mechanism:

  http://article.gmane.org/gmane.comp.lib.glibc.locales/96
  http://article.gmane.org/gmane.comp.lib.glibc.locales/97

I guess the problem is that the dot has a different meaning in the
context of file names so "ls" should try to do something clever like
splitting the extension from the basename and sort the basenames
first.

-- 
Ole Laursen
http://www.cs.aau.dk/~olau/




reply via email to

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