wc -c

Hi,

When I use wc -c :

echo "word" |wc -c
5

The number is number of letters +1

I don't understand... Where is the probleme?
I am on AIX but on HP, it the same probleme.

.....

wc is counting the newline character...

$ echo "word" | od -c
0000000 w o r d \n
0000005
$ printf "word" | od -c
0000000 w o r d
0000004

Perhaps use expr to find the word length..

$ expr length "word"
4

It is strange.... :confused:

Thank you for your answer
:wink:

there was a discussions about this mabey 1 or 2 months ago w/ Perderabo posting in that thread. I think i might have also posted in that thread. but it covered it pretty good.

Optimus, Have you a link to this discution for me? It's could be interesting....
I can't find it....

Thanks