bug-fileutils
[Top][All Lists]
Advanced

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

Re: problem with ls -a


From: Bob Proulx
Subject: Re: problem with ls -a
Date: Sat, 23 Jun 2001 18:17:29 -0600

> I hadn't noticed this personally because I don't use the -a option that
> much. But I saw a discussion about it on comp.unix.shell, and thought
> I'd mention it in case nobody else did.
> 
> What people have come to expect from -a is that the dot files will all
> appear before other files. In the ls that comes with fileutils 4.0.36,
> they are intermixed. For example:

Your report matches a common pattern in the sort command.  I realize
you are using ls command.  But I believe this applies to your use of
ls because it will sort using the collating sequence of the presently
defined locale.  Jim has previously answered these reports with the
following mail.  Note that some vendors set those language variables
for you without you being aware of them.  If this does not fix your
problem let us know.

Bob

========================================================================

Jim Meyering writes:

Thanks for the report.
Here's the canned reply:
------------

You are using the version of sort that comes with textutils-2.0
or newer and have reported a problem whereby it is sorting in
some non-ASCII order.

That is due not to a bug in sort, but to the fact that you have
set environment variables that direct sort to use improper locale-
specific tables (you or your vendor have probably set environment
variables like LANG, LC_ALL, or LANGUAGE to en_US).

Unset them, and then set LC_ALL to POSIX

  # If you use bash or some other Bourne-based shell,
  export LC_ALL=POSIX

  # If you use a C-shell,
  setenv LC_ALL POSIX

and sort will then work the way you expect.
-----------

BTW, in recent textutils test releases, sort --help output
includes this:

  *** WARNING ***
  This version of sort honors the locale settings in your environment.
  For example, if you set one of the LANG or LC_ALL environment variables
  to `en_US', then sort will work very differently than most people expect.
  If that's not what you want, then set LC_ALL to POSIX in your environment.

> $ unalias ls
> $ ls -a
> .                       News
> ..                      .newsrc
> .acrorc                         .newsrc~
> .bash_history           .newsrc.eld
> .bash_logout            .newsrc.eld~
> .bash_profile           .newsrc-news
> .bashrc                         nsmail
> bin                     office52
> .cddbslave              personal
> core                    pictures
> .cpan                   .RealNetworks_RealCookies_60
> .DCOPserver_linux1      .RealNetworks_RealMediaSDK_60
> Desktop                         .RealNetworks_RealPlayer_60
> .dxpc.pid-linux1-jhalpin  .RealNetworks_RealShared_00
> .emacs                          Reqrd_Info_for_OneTime_ENC_Review.doc
> .emacs~                         .saves-15009-linux1~
> .esd_auth               .saves-15971-linux1~
> getMail.pl              .saves-1756-linux1~
> getMail.pl~             .saves-29559-linux1~
> .gimp-1.2               .saves-355-linux1~
> .gnapster               .sawfish
> .gnome                          .screenrc
> .gnome-desktop                  Socket.plman
> .gnome_private                  sounds
> .gnus                   .sversionrc
> .gnus~                          test.pl
> .gtkrc-kde              test.pl~
> House.jpg               test.sh
> .ICEauthority           tmp
> .kde                    .user52.rdb
> .kderc                          .viminfo
> .kxmlrpcd               vsclient
> .kxmlrpcd-socket-jthyta   .wl
> .Maelstrom-data                 work
> .mc                     .xauth
> .MCOP-random-seed       .Xauthority
> .mcoprc                         .xmms
> .mozilla                .Xresources
> .netscape               .xsession-errors
> 
> $ ls --version
> ls (GNU fileutils) 4.0.36
> Written by Richard Stallman and David MacKenzie.
> 
> Copyright (C) 2000 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is
> NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
> 
> 
> This is on the RedHat 7.1 distribution of Linux. I suppose RedHat might
> have hacked it for some reason, but thought you'd want to know either
> way.
> 
> Joe



reply via email to

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