[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9166: wc -m that the resulting number is wrong
From: |
Eric Blake |
Subject: |
bug#9166: wc -m that the resulting number is wrong |
Date: |
Mon, 25 Jul 2011 06:15:44 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11 |
tag 9166 invalid
thanks
On 07/24/2011 03:58 PM, Paul Ingerson wrote:
for example echo "A" | wc -m yield 2 instead of 1. Why is this?
Thanks for the report; however, this is not a bug. In your example,
echo "A" really did output two characters: A and newline. Try:
echo A | od -tx1z
to see those characters, and try:
printf A | wc -m
to see the difference (since printf does not output a trailing newline).
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org