GNU bug report logs - #24225
ls doesn't quote newlines with -Q properly

Previous Next

Package: coreutils;

Reported by: "E. Choroba" <choroba <at> matfyz.cz>

Date: Sun, 14 Aug 2016 17:46:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24225 in the body.
You can then email your comments to 24225 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#24225; Package coreutils. (Sun, 14 Aug 2016 17:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "E. Choroba" <choroba <at> matfyz.cz>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 14 Aug 2016 17:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "E. Choroba" <choroba <at> matfyz.cz>
To: bug-coreutils <at> gnu.org
Subject: ls doesn't quote newlines with -Q properly
Date: Sun, 14 Aug 2016 19:13:33 +0200 (CEST)
[Message part 1 (text/plain, inline)]
Filename containing a newline is not listed in a way reusable by shell 
regardless of the --quoting-style:

$ touch a$'\n'b
$ for s in literal shell shell-always c c-maybe escape locale clocale ; do
      ls -Q a?b --quoting-style=$s
  done
a?b
'a?b'
'a?b'
"a\nb"
"a\nb"
a\nb
‘a\nb’
‘a\nb’

I'd expect something like $'a\nb' (might be bash specific) or 'a
b' (i.e. containing the actual newline) or something.

Versions:

bash 4.2.53(1)-release
ls (GNU coreutils) 8.23
system: OpenSUSE 13.2 x86_64

Reference:
http://stackoverflow.com/q/38938218/1030675

Ch.

Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Mon, 15 Aug 2016 09:05:01 GMT) Full text and rfc822 format available.

Notification sent to "E. Choroba" <choroba <at> matfyz.cz>:
bug acknowledged by developer. (Mon, 15 Aug 2016 09:05:02 GMT) Full text and rfc822 format available.

Message #10 received at 24225-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: "E. Choroba" <choroba <at> matfyz.cz>, 24225-done <at> debbugs.gnu.org
Subject: Re: bug#24225: ls doesn't quote newlines with -Q properly
Date: Mon, 15 Aug 2016 10:04:46 +0100
On 14/08/16 18:13, E. Choroba wrote:
> Filename containing a newline is not listed in a way reusable by shell 
> regardless of the --quoting-style:

There were many cases where the output from ls was unusable.
This was fixed since coreutils-8.25 where the new 'shell-escape'
quoting style was introduced, and in fact is used by default.

  $ ls a?b --quoting-style='shell-escape'
  'a'$'\n''b'

thanks,
Pádraig




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 12 Sep 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 333 days ago.

Previous Next


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