bug-coreutils
[Top][All Lists]
Advanced

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

bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input


From: L A Walsh
Subject: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input
Date: Sun, 08 Jan 2017 21:21:52 -0800
User-agent: Thunderbird

Andreas Schwab wrote:
On Jan 06 2017, L A Walsh <address@hidden> wrote:
The new ls doesn't maintain backwards compatibility.
The default options now add extraneous quotes to
some filenames.
---
Does it?

$ touch 'a b'
$ ls -1 | grep "'"
----
        Sorry, you are right.

        The problem is 'ls' doesn't show the same
information on the screen when it is passed through
a pager like "less" or "more".
        In all but the smallest of directories, it's virtually
a requirement to page directory output using 'more' or 'less'.

        Having 'ls' show different output through a pager
than it does when scrolling off the screen is not a standard
feature. The user has no idea how to page through 'ls's output as they saw it scroll by on the screen. It's inconsistent with any other tools that work with pagers as well as being inconsistent with itself in how it handles COLOR options.

        'ls' should default to its regular behavior and
only engage quoting when asked to.
        Let distros and users decide what to enable
to add new behaviors -- like the various color options.
My distro added color by default in their defaults
w/it only on when output is not a pipe.

        I changed it on my machine to put out color
even if through a pipe as I usually am piping it through
'less' and I want to see the color.  If I want no color --
I can get the normal text by adding a backslash before
the command.

        The new quoting also messes up copy/pasting into
any place other than the shell. I tend to copy/paste between a shell and gvim when doing script development. I wouldn't mind having such a switch as an option, but it is usually the case that I can copy/paste between
windows and have it pick up whether or not a tab or a space
was used.  Having tabs converted to a shell code would
prevent them being expanded anyplace but in the same shell.

Follow the example of COLOR and let users (including distros)
decide what to enable. It will let those who want such
to have it on, but not cause confusion or compatibility
problems.








reply via email to

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