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


View this message in rfc822 format

From: Davide Brini <dave_br <at> gmx.com>
To: 9449 <at> debbugs.gnu.org
Subject: bug#9449: Bug report on 'wc' : characters count adds one character
Date: Tue, 6 Sep 2011 16:22:00 +0200
On Tue, 6 Sep 2011 15:49:24 +0200, "Laurent TARRISSE"
<ltarrisse <at> midilibre.com> wrote:

> Hi,
> 
> Documentation on 'wc' says:
> ----------------------------------------------
> wc -m, --chars
>               print the character counts
> 
> ----------------------------------------------
> 
> But here follows the output I get:
> 
> >echo toto | wc --chars
> 5
> >echo five | wc --chars
> 5
> >echo four | wc --chars
> 5
> >echo f  | wc --chars
> 2
> >echo "" | wc --chars
> 1
> 
> Why does 'wc' add one character ?

wc isn't adding anything. If you do "echo toto" you're sending five
characters to the pipe. Try this:

echo toto | od -c


-- 
D.




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.