[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6285: a possible bug of "sort -un", it is definitely not caused by l
From: |
Eric Blake |
Subject: |
bug#6285: a possible bug of "sort -un", it is definitely not caused by language setting |
Date: |
Thu, 27 May 2010 16:52:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4 |
On 05/27/2010 02:30 PM, daimh wrote:
> Hi,
>
>
> echo -e "3\n\n0"|sort -un
'echo -e' is inherently non-portable; you should get in the habit of
using printf(1) instead.
>
>
> 0 is missing from output, is this a possible bug?
Thanks for the report. However, I don't think it is a bug. The empty
line, when forced to take on a numeric value, is equivalent to 0. And
since you specified unique entries only, sort only printed the empty
line (the first of the two matching lines that it encountered).
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature