bug-fileutils
[Top][All Lists]
Advanced

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

ls sorting behavior changed in fileutils-4.1


From: Keith Thompson
Subject: ls sorting behavior changed in fileutils-4.1
Date: Mon, 11 Jun 2001 19:14:59 -0700
User-agent: Mutt/1.2.5i

This problem was pointed out by Victor Zandy <address@hidden>
in a recent post to gnu.misc.discuss.

The sorting behavior of the ls command has changed between
fileutils-4.0 and fileutils-4.1 (and between Redhat 7.0 and 7.1).
In my opinion, the new behavior is incorrect.  The change is not
mentioned in the documentation as far as I can tell.

A workaround is to set the environment variable $LC_ALL to "C",
but a user shouldn't have to do this.

System: i686-pc-linux-gnu

Script:
========================================================================
#!/bin/sh

#
# Obviously these pathnames won't be valid elsewhere.
#
ls4_0=/home/kst/apps/i686-pc-linux-gnu/fileutils-4.0/bin/ls
ls4_1=/home/kst/apps/i686-pc-linux-gnu/fileutils-4.1/bin/ls

mkdir /tmp/$$
cd /tmp/$$
touch .a .b .c A B C a b c

for lc_all in none C ; do
    if [ $lc_all == 'none' ] ; then
        echo 'Not setting $LC_ALL'
        unset LC_ALL
    else
        echo 'setting LC_ALL=C'
        LC_ALL=C
        export LC_ALL
    fi
    echo "using fileutils-4.0:"
    $ls4_0 -A
    echo "using fileutils-4.1:"
    $ls4_1 -A

    echo ''

done

cd /tmp
rm -rf $$
========================================================================

Output:
========================================================================
Not setting $LC_ALL
using fileutils-4.0:
.a  .b  .c  A  B  C  a  b  c
using fileutils-4.1:
a  .a  A  b  .b  B  c  .c  C

setting LC_ALL=C
using fileutils-4.0:
.a  .b  .c  A  B  C  a  b  c
using fileutils-4.1:
.a  .b  .c  A  B  C  a  b  c

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

-- 
Keith Thompson, San Diego Supercomputer Center  address@hidden
<http://www.sdsc.edu/~kst/>  Office: 858-822-0853  Fax: 858-534-5077
Cxiuj via bazo apartenas ni.



reply via email to

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