[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: busybox sort wrong with -t/-k
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2015-09-19 20:07:58
Message-ID: CAK1hOcO_NvA9HqOoMWTTVLytAykzekqBsOaz0Xt0hpGzwFpBzQ () mail ! gmail ! com
[Download RAW message or body]

Thank for reporting. fixed in git.

On Thu, Sep 17, 2015 at 9:04 PM, Christian Neukirchen
<chneukirchen@gmail.com> wrote:
> Hi,
>
> I noticed the following difference in output:
>
> GNU sort 8.24 and FreeBSD 10.2 sort:
>
> % printf '%s\n' a/a:a a:b | sort -t: -k1
> a/a:a
> a:b
> % printf '%s\n' a/a:a a:b | sort -t: -k1,1
> a:b
> a/a:a
>
> BusyBox v1.23.2 (2015-08-12 12:31:27 UTC) multi-call binary.
> Linux juno 4.1.7_1 #1 SMP PREEMPT Mon Sep 14 04:46:51 UTC 2015 x86_64 GNU/Linux
>
> % printf '%s\n' a/a:a a:b | busybox sort -t: -k1
> a/a:a
> a:b
> % printf '%s\n' a/a:a a:b | busybox sort -t: -k1,1
> a/a:a
> a:b
>
> -k1 means the rest of the line after field 1 is included, sorting
> a/a:a before a:b since '/' comes before ':'.
> -k1,1 means that only the first field should be regarded as key, thus
> a comes before a/a.
>
> Thanks,
> --
> Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic