bug-textutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wc (GNU textutils) 1.22 miscounting characters?


From: Bob Proulx
Subject: Re: wc (GNU textutils) 1.22 miscounting characters?
Date: Sun, 25 Mar 2001 22:35:20 -0700

> % /bin/echo 12345|/usr/bin/wc -c
>       6
> 
> (shouldn't that be 5 not 6????)
> 
> (It is consistent...  'echo |wc -c' gives '1'...... 'echo 1 |wc -c' gives
> '2......)
> 
> What am I missing?

You are forgetting about the newline character that echo is writing at
the end of the line.

  /bin/echo 12345| od -c
  0000000   1   2   3   4   5  \n
  0000006

:-)

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]