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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pádraig Brady <P <at> draigBrady.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#24225: closed (ls doesn't quote newlines with -Q properly)
Date: Mon, 15 Aug 2016 09:05:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 15 Aug 2016 10:04:46 +0100
with message-id <57B185AE.9060705 <at> draigBrady.com>
and subject line Re: bug#24225: ls doesn't quote newlines with -Q properly
has caused the debbugs.gnu.org bug report #24225,
regarding ls doesn't quote newlines with -Q properly
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
24225: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24225
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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.
[Message part 4 (message/rfc822, inline)]
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


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

Previous Next


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