GNU bug report logs - #9449
Bug report on 'wc' : characters count adds one character

Previous Next

Package: coreutils;

Reported by: "Laurent TARRISSE" <ltarrisse <at> midilibre.com>

Date: Tue, 6 Sep 2011 14:03:01 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


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

From: Eric Blake <eblake <at> redhat.com>
To: Laurent TARRISSE <ltarrisse <at> midilibre.com>
Cc: 9449-done <at> debbugs.gnu.org
Subject: Re: bug#9449: Bug report on 'wc' : characters count adds one character
Date: Tue, 06 Sep 2011 08:25:28 -0600
tag 9449 notabug
thanks

On 09/06/2011 07:49 AM, Laurent TARRISSE wrote:
>> echo toto | wc --chars
> 5

Thanks for the report; however, this is correct.  wc is counting the 
newline output by echo.

Try these to see the difference:

$ printf toto | wc --chars
4
$ echo toto | od -tx1z

> Why does 'wc' add one character ?

It doesn't.  Echo does.

-- 
Eric Blake   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




This bug report was last modified 13 years and 326 days ago.

Previous Next


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