Well linux and solaris get it correct, but it looks like the little old mac can't sort things lexicographically (even when it claims in the manpage that it does).
On Linux/Solaris:
The following environment variables shall affect the execution of ls ...
On Linux/Solaris:
~/x% locale LANG=en_IE.UTF-8 LC_CTYPE="en_IE.UTF-8" LC_NUMERIC="en_IE.UTF-8" LC_TIME="en_IE.UTF-8" LC_COLLATE="en_IE.UTF-8" LC_MONETARY="en_IE.UTF-8" LC_MESSAGES="en_IE.UTF-8" LC_PAPER="en_IE.UTF-8" LC_NAME="en_IE.UTF-8" LC_ADDRESS="en_IE.UTF-8" LC_TELEPHONE="en_IE.UTF-8" LC_MEASUREMENT="en_IE.UTF-8" LC_IDENTIFICATION="en_IE.UTF-8" LC_ALL= ~/x% ls a B cOn the Mac:
himitsu:~/x% locale LANG="en_IE.UTF-8" LC_COLLATE="C" LC_CTYPE="en_IE.UTF-8" LC_MESSAGES="en_IE.UTF-8" LC_MONETARY="en_IE.UTF-8" LC_NUMERIC="en_IE.UTF-8" LC_TIME="en_IE.UTF-8" LC_ALL= himitsu:~/x% ls B a cAccording to the spec:
The following environment variables shall affect the execution of ls ...
LC_COLLATESad little mac does not sort by the locale's character collation specification (case insensitive, in case you missed it).Determine the locale for character collation information in determining the pathname collation sequence.
Whatcha expect when you bought a Fisher Price PC? ;-)