GNU bug report logs - #41075
Changes to 'ls' output

Previous Next

Package: coreutils;

Reported by: Chris Elvidge <celvidge001 <at> gmail.com>

Date: Mon, 4 May 2020 12:34:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Chris Elvidge <celvidge001 <at> gmail.com>, 41075 <at> debbugs.gnu.org
Subject: bug#41075: Changes to 'ls' output
Date: Mon, 4 May 2020 16:14:20 +0100
tag 41075 notabug
close 41075
stop

On 04/05/2020 10:43, Chris Elvidge wrote:
> I have noticed that the output of ls seems to have changed from v8.25 to
> v8.32 where there is an apostrophe in the filename (sometimes); change
> from " surrounding to ' surrounding and '\'' replacing '. When output is
> piped through xxd, it is the same in both versions. I have 8.32
> installed in ~/bin/. Any ideas?

This is due to new quoting functionality which is discussed at:
https://www.gnu.org/software/coreutils/quotes.html

As to your particular observation,
when there are only single quotes, then we'll change
to using double quotes to simplify the quoting.
Once there are other problematic characters,
we switch to quoting with single quotes,
as shown in these examples:

  $ ls -1
  "just'single"
  'single'\''and(brackets)'

Note quoting is disabled when output is not to a terminal.

  $ ls -1 | cat
  just'single
  single'and(brackets)

You can disable this quoting behavior if you prefer, by adding '-N' to your ls alias.

thanks,
Pádraig




This bug report was last modified 5 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.