GNU bug report logs - #14299
Incorrect output of `printf "\\n"`

Previous Next

Package: coreutils;

Reported by: Pavel Elkind <elkind <at> chalmers.se>

Date: Mon, 29 Apr 2013 00:20:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Davide Brini <dave_br <at> gmx.com>
To: 14299 <at> debbugs.gnu.org
Subject: bug#14299: Incorrect output of  `printf "\\n"`
Date: Mon, 29 Apr 2013 17:44:02 +0200
On Sun, 28 Apr 2013 18:44:23 +0000, Pavel Elkind <elkind <at> chalmers.se> wrote:

> Dear developers,
> 
> I found the following potential bug in printf (version 8.17).
> 
> Actual result: 
> `printf "\\n"` prints a newline caracter.
> 
> Expected result:
> `printf "\\n"` prints a sequence of two individual characters, '\' and
> 'n', like '\n',  but  not a newline character.
> 
> Please address the above issue,

printf '\\n'

is what you want. Printf has nothing to do with this, it's the shell that
interpolates \\ when it's in double quotes.


-- 
D.




This bug report was last modified 12 years and 29 days ago.

Previous Next


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