bug-textutils
[Top][All Lists]
Advanced

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

Re: (no subject)


From: Jim Meyering
Subject: Re: (no subject)
Date: Fri, 24 Aug 2001 10:51:47 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.105

address@hidden wrote:
> I have a little question. When I am working with my Terminal and ask him how
> long the word counter is he tells me, oh, the word is longer than it is. For
> example:
> I tell him "foo bar" and I count up to seven characters, you know, he says
> stupiderweise eight, damn it but also... so i wish to question you:
> why is my terminal telling me such things?
> Thank you for question answering

If you did it via `echo foo bar|wc -c', then that's not surprising.
wc is counting the trailing newline byte.  Do this instead:

  echo -n 'foo bar'| wc -c

or this:

  echo 'foo bar' | tr -d '\n' | wc -c

Both print `7'.



reply via email to

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