Good day Rob. On Thu, Jan 6, 2022 at 12:59 AM Rob Landley <[email protected]> wrote: > We presumably got pinged by the same guy. Over on my side of the mirror > https://github.com/landley/toybox/issues/184 and > https://github.com/landley/toybox/issues/312 resulted me adding and then > removing the feature again: > > commit b0a4a96e36da616dabff85917c0155b1dd59f45c > Author: Rob Landley <[email protected]> > Date: Sun Jan 2 20:05:09 2022 -0600 > > Remove non-posix "sort -h". > > The man page says this is EXPECTED to be in the wrong order: > > $ echo -e '12345K\n1M' | sort -h > 12345K > 1M > > That's not how toybox treats numerical units anywhere else, and our > options > are to be incompatible with the broken gnu thing, inconsistent with > the rest of toybox, or not have the broken non-posix feature. So yank it.
I assume they want to be able to sort outputs like "df -h". In those cases, they assume the values are not "malformed" in the sense of using numbers like e.g. 3456K _and_ 2M in the same output. They assume the input has a fixed cutoff value where the output switches from "K" to "M". I think the idea is that with this logic, they don't need to assume whether "K" is 1000, 1024 or anything else. > 2 days later, busybox added sort -h, but I can't find any comment on the list > about it? There was a BZ: https://bugs.busybox.net/show_bug.cgi?id=14491 "Support sort -h" from someone called Kasper. I looked into how this can be made to work and it turned out to be rather easy. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
