Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: nesting issue



On Sun, May 5, 2024, at 9:51 PM, Ray Andrews wrote:
> There will be an algorithm I'd just like to know what it is.

It's not that simple.  You're conflating the sorting method with
the locale's collation rules.  Under Debian's en_US.UTF-8 locale
even straight lexicographic sort can be surprising:

	% foo=(1, 1a,); print -lr -- ${(o)foo}
	1,
	1a,
	% foo=(1,a 1a,a); print -lr -- ${(o)foo}
	1,a
	1a,a
	% foo=(1,b 1a,b); print -lr -- ${(o)foo}
	1a,b
	1,b

I'm afraid I can't explain this; perhaps someone else can.  If it
bothers you, consider temporarily setting LC_ALL=C (or C.UTF-8)
while you sort.

-- 
vq




Messages sorted by: Reverse Date, Date, Thread, Author