GNU bug report logs - #23422
stat -c %N returns strange results for file names including <TAB>

Previous Next

Package: coreutils;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Mon, 2 May 2016 09:29: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: Ruediger Meier <sweet_f_a <at> gmx.de>
To: 23422 <at> debbugs.gnu.org
Subject: bug#23422: stat -c %N returns strange results for file names including <TAB>
Date: Wed, 4 May 2016 10:28:21 +0200
On Tuesday 03 May 2016, Paul Eggert wrote:
> On 05/02/2016 03:19 PM, Ruediger Meier wrote:
> > This new quoting style default is just ugly, unreadable and
> > annoying.
>
> If you can think of an unambiguous output style that is beautiful,
> readable, and pleasant, please let us know.

Looking again at the OP's example
  'foo'$'\t''bar'
it's not so difficult to imagine a better quoting style. It would be 
more difficult to make it more ugly ... Nobody would ever type this 
string like this, mixing and changing the quotes a few times within one 
string. Moreover it's unusable for most use cases (except shell 
copy/paste).

The old behavior 'foo\tbar' seems like C style which was already nice to 
read and also unambiguous I guess. Adding a $ in front of that C string 
should work in shell too, or not?

Anyways the incompatible change is IMO not acceptable. %N is probably 
most likely used in scripts which rely on the known style. One argument 
to defend the ugly quoting style change in ls(1) was that it's usually 
only used interactively. This is not the case for stat -c.

cu,
Rudi




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

Previous Next


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