I was checking this, but it seems is weird on the GNU side too:

❯ sort -k3 cnt-sort         
17 new1 5434 online postgres /var/lib/postgresql/17/new1 
/var/log/postgresql/postgresql-17-new1.log
17 old  5435 online postgres /var/lib/postgresql/17/old 
/var/log/postgresql/postgresql-17-old.log
17 new2 5440 online postgres /var/lib/postgresql/17/new2 
/var/log/postgresql/postgresql-17-new2.log

❯ LC_ALL=C sort -k3 cnt-sort                        
17 old  5435 online postgres /var/lib/postgresql/17/old 
/var/log/postgresql/postgresql-17-old.log
17 new1 5434 online postgres /var/lib/postgresql/17/new1 
/var/log/postgresql/postgresql-17-new1.log
17 new2 5440 online postgres /var/lib/postgresql/17/new2 
/var/log/postgresql/postgresql-17-new2.log

So when using my locale (it_IT.UTF-8) is behaving differently...

But this is stated on the --help too:

*** WARNING ***
The locale specified by the environment affects sort order.
Set LC_ALL=C to get the traditional sort order that uses
native byte values.

So basically we should make the rust side locale-affected too!

---

This should be handled in https://github.com/uutils/coreutils/pull/9176

** Bug watch added: github.com/uutils/coreutils/issues #9148
   https://github.com/uutils/coreutils/issues/9148

** Also affects: rust-coreutils via
   https://github.com/uutils/coreutils/issues/9148
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2125504

Title:
   /usr/bin/sort: -k option does not behave as GNU's sort

To manage notifications about this bug go to:
https://bugs.launchpad.net/rust-coreutils/+bug/2125504/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to