On Tue, 6 Sep 2011 15:49:24 +0200, "Laurent TARRISSE"
<[email protected]> 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.



Reply via email to