coreutils
[Top][All Lists]
Advanced

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

Re: ls output changes considered unacceptable


From: Michael Stone
Subject: Re: ls output changes considered unacceptable
Date: Thu, 18 Feb 2016 07:44:52 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Feb 18, 2016 at 01:17:09AM -0800, you wrote:
compared to the suggestions I got privately to commit suicide.
The vocal minority feel strongly about change.

Yeah, it's the discussions on other forums I was reacting to. Crazy.

ls is really quite difficult to parse programmatically.
I expanded on an example elsewhere, showing how awkward
and non practical it is.

Agree completely, if someone's piping ls to their script they're doing it wrong. The case I'm thinking about is simply copy and pasting a filename into a script.

An improvement suggested by someone else, would improve both the ambiguity
and the small alignment issue, by adding an extra space to ls -l output
if any names are quoted. That would also give a better indication that
ls was adding the quotes. I.E.:

-rw-rw-r--.   1 padraig padraig    580 Dec 14 04:01  blah_blah
-rw-rw-r--.   1 padraig padraig    580 Dec 14 04:01 'blah blah'

I saw that, it's certainly an improvement for -l but doesn't do anything for plain ls.

'I don'\''t think this is optimal.docx'  'My eye'\''s bleedin'\''.docx'  
Simple.docx

Again these are edge cases.

I think the crux of the matter is how common that is on a particular system. For some people it's being hit often, and for those people it's a major regression in simple readability.
As Eric suggests it might be appropriate to use
double quotes to simplify this "common" case.

It's hard to say. It certainly makes it look better, but having three different possible states for a filename (no quotes, single quotes, double quotes) makes the surprise factor even worse.
In contrast, the case for the change doesn't seem that compelling:

"It's less ambiguous" -- Maybe in some ways, but are there real-world
cases where it's a useful distinction?

Yes. I've hit this many times with spaces in names.

I guess it comes down to whether someone mouses more than they type & tab complete.

If reducing the ambiguity of the output is really a goal, then the quoting
should be pervasive/consistent rather than changing on a per-file basis.
It should also be minimally verbose. I'd rather see the default be
--quoting-style=c than --quoting-style=shell-escape.

Each to their own :)
But that would be less directly usable on the shell.

I'm a tcsh user. :-)
Mike Stone



reply via email to

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