On 09/29/2014 02:47 PM, Eric Blake wrote:
> tag 18585 notabug
> thanks
> 
> On 09/29/2014 07:25 AM, Schapovalov, Sebastian wrote:
>> Hello, I was testing one parameter in my .sh and realised that the wc 
>> command return a different value that I was expected.  I send you a couple 
>> examples.
>>
>> I have to validate a celular telephone number (in Argentina), so, it has to 
>> be a 10 chars parameter.
>>
>> sarasa() -- seba > echo 1029384756 | wc -c
>> 11
> 
> Classic user mistake.  'echo' outputs a trailing newline, which IS a
> character,
> 
>> sarasa () -- seba > echo 1029384756 | wc -L
>> 10
> 
> but does NOT contribute to the length of the longest line.  Try
> comparing these two commands
> 
> echo 1029384756 | oc -tx1z
> printf 1029384756 | oc -tx1z

Typo; I meant 'od' in both lines, not 'oc'.

> 
> to see what I mean.
> 
> I'm closing this as not a bug, but feel free to ask further questions.
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to