try:
echo -n "stuff"|wc
echo adds a newline, so if you count by bytes
or chars
, there is at least 1
see following examples:
kent$ echo ""|wc -c
1
kent$ echo -n ""|wc -c
0
kent$ echo ""|wc -m
1
kent$ echo -n ""|wc -m
0
if you count by "word", there is no difference:
kent$ echo -n ""|wc -w
0
kent$ echo ""|wc -w
0