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: "E. Choroba" <choroba <at> matfyz.cz>
To: 24225 <at> debbugs.gnu.org
Subject: bug#24225: 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.

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

Previous Next


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