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

List:       busybox
Subject:    Re: sort's -k flag is buggy when M is also passed
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2022-07-29 14:07:17
Message-ID: CAK1hOcMJ-yTFTHPkXFS=1NgeK6HRc=rnnfBbUWbe2LrH5vb+og () mail ! gmail ! com
[Download RAW message or body]

Fixed in git. Thank you.

On Wed, Jun 29, 2022 at 7:11 AM Dennis Chen <dchen@dennisc.net> wrote:
>
> All commands were run on both Ubuntu busybox v1.30.1 and Alpine busybox
> v1.35.0.
>
> I ran
>         echo "3 March\n2 April" | busybox sort -k 2,2M
> and it returned
>         2 April
>         3 March
> It should return
>         3 March
>         2 April
> and indeed, that is what you get with GNU sort. (It doesn't seem to
> matter what the numbers "2" and "3" are - I replaced them both with the
> string "filler" and got the same result.)
>
> This seems to only happen when the field number is >1. For instance
>         echo "March\nApril" | busybox sort -k 1,1M
> correctly outputs
>         March
>         April
>
> It also doesn't happen when M isn't passed into -k. For instance,
>         echo "a c\nb b" | sort -k 2,2
> correctly returns
>         b b
>         a c
> _______________________________________________
> 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