Subject: Re: bug#9449: Bug report on 'wc' : characters count adds one character

From: Eric Blake <[email-masked]>
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   [email-masked]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org