Thread: wc anomaly
View Single Post

   
  #4 (permalink)  
Old 04-03-2008, 02:45 PM
RedGrittyBrick
 
Posts: n/a
Default Re: wc anomaly

Jeff Hyman wrote:
> # echo "abcde" > /tmp/foo
> # wc -m /tmp/foo (-c flag gives same results)
> 6 foo
>
> Am I going nuts, or is this a bug?
> File 'foo' has 5 characters, not 6 ... and no blank lines or spaces.
>
> If this is the way it's supposed to be, then
> how can one rely on its output except to remember
> to subtract 1 ?


echo adds a linefeed.

--
RGB
Reply With Quote