coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort and collation


From: Pádraig Brady
Subject: Re: sort and collation
Date: Tue, 26 Nov 2024 21:52:06 +0000
User-agent: Mozilla Thunderbird Beta

On 26/11/2024 04:31, Magnus Fromreide wrote:
Hello!

I tried to sort a file containing the lines
[X].Y
[X].W
[XZ]
[XX]
and got confused when sort returned
[X].W
[XX]
[X].Y
[XZ]
rather than
[XX]
[XZ]
[X].W
[X].Y
where the [X] values where kept together.

It seems that the problem is that my locale (en_US.utf8) specifies that
punctuation, like [, ], and ., is insignificant.

This is actually very close to what the -d flag to sort does but in my case
it is just confusing.

* Would it be possible to have a flag that tells sort to treat all input
   characters as unique entities and just compare their values?

* Would it be possible to combine that flag with the ignore case flag or
   does input characters where case transformation adds multiple characters
   kill that idea?

* Would it be possible to have a flag that tells sort to just perform an
   octet comparision, similar to 'LC_ALL=C sort' but slightly more ergonomic?

Well `LC_ALL=C sort -f` is the canonical way to do as you suggest,
which works with all sort versions and implementations.
I'm not sure it's worth adding a flag to do this.

thanks,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]