bug-coreutils
[Top][All Lists]
Advanced

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

bone to pick with ls


From: Burt Smith
Subject: bone to pick with ls
Date: Tue, 20 Jul 2004 13:42:40 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040608


Hello,

I believe that the latest version of ls is broken.  Version info:

------------------------------------------------------------
ls (coreutils) 5.2.1
Written by Richard Stallman and David MacKenzie.

Copyright (C) 2004 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.
------------------------------------------------------------

With the most recent changes to ls, there is no way, regardless
of options, to get ls to work the way it used to in all flavors
of unix that I've used in the past few decades.

Consider a symbolic link to a directory:

lrwxrwxrwx  1 bsmith bsmith      6 Jul 14 12:48 foo -> ../bar

(where bar is a directory containing file1 .. file8.)

I always alias ls to 'ls -F'.  So, if I were in the directory
containing foo and did my ls, I would expect to get:

% ls
foo@
% ls foo
file1  file3  file5  file7
file2  file4  file6  file8
% ls -l foo
lrwxrwxrwx  1 bsmith bsmith      6 Jul 20 13:18 foo -> ../bar/
% ls -L foo
file1  file3  file5  file7
file2  file4  file6  file8
%

----------

If I now alias ls as 'ls -F', I get:

% ls
foo@
% ls foo
foo@
% ls -l foo
lrwxrwxrwx  1 bsmith bsmith      6 Jul 20 13:18 foo -> ../bar/
% ls -L foo
file1  file3  file5  file7
file2  file4  file6  file8
%

Well, no, that's not right.  I want to see the contents of
the directory when I do 'ls foo'.

----------

So I can try this new option, -H, that has appeared, and alias
ls as 'ls -FH':

% ls
foo@
% ls foo
file1  file3  file5  file7
file2  file4  file6  file8
% ls -l foo
total 0
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file1
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file2
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file3
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file4
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file5
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file6
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file7
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file8
% ls -L foo
file1  file3  file5  file7
file2  file4  file6  file8
%

No, taht's not quite right either.  I don't want
ls -l on a link to show me the contents.

----------

So I can try the new option someone seems to have added
in an attempt to fix this issue:

    --dereference-command-line-symlink-to-dir

 ls
foo@
% ls foo
file1  file3  file5  file7
file2  file4  file6  file8
% ls -l foo
total 0
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file1
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file2
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file3
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file4
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file5
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file6
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file7
-rw-r--r--  1 bsmith bsmith 0 Jul 20 13:17 file8
% ls -L foo
file1  file3  file5  file7
file2  file4  file6  file8
%

No, that's no better than 'ls -FH' for directories,
though it IS better for non-directories.

----------

Can I get someone to change this new behavior
to an option and to restore the original behavior?

Or alternately, to change the behavior of the new
--dereference-command-line-symlink-to-dir to use the
'classic' manner (i.e. with ls -l it does NOT dereference
unless -L is also present).

It may not seem like a big deal, but it is a constant
irritation for me :(

    many thanks,
    -burt

--
------------------- Meega, nala kweesta! --------------------
burt smith ---------- tdc wallingford ---------  203/741-3029





reply via email to

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