• Re: Rationale for aligning data on even bytes in a Unix shell file?

    From Scott Dorsey@21:1/5 to vallor@cultnix.org on Thu May 1 20:30:08 2025
    vallor <vallor@cultnix.org> wrote:
    On Linux, try:

    LC_COLLATE=C ls -l

    ...and the capitalized filenames will float to the top.

    (Discovered by logging into my Panix shell and inspecting
    the behavior and settings there.)

    Does it work on linux as well as on the Panix machines?
    --scott

    --
    "C'est un Nagra. C'est suisse, et tres, tres precis."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to All on Fri May 2 03:03:18 2025
    On Thu, 1 May 2025 20:30:08 -0400 (EDT), kludge@panix.com (Scott Dorsey)
    wrote in <vv13mg$i2c$1@panix2.panix.com>:

    vallor <vallor@cultnix.org> wrote:
    On Linux, try:

    LC_COLLATE=C ls -l

    ...and the capitalized filenames will float to the top.

    (Discovered by logging into my Panix shell and inspecting the behavior
    and settings there.)

    Does it work on linux as well as on the Panix machines?
    --scott

    Yes.

    Here's what's up. When I run locale(1) on Linux Mint, I see:

    [...]
    LC_COLLATE="en_US.UTF-8"
    [...]

    So ordering is case-insensitive, apparently:

    $ ls -l
    total 28
    -rwxrwxr-x 1 vallor vallor 16016 Jan 10 2024 ckarray
    -rw-rw-r-- 1 vallor vallor 169 Jan 10 2024 ckarray.c
    -rw-rw-r-- 1 vallor vallor 24 May 1 19:59 Makefile
    -rw-rw-r-- 1 vallor vallor 63 Jan 10 2024 phrase.txt

    But setting it to "C", I get:

    $ LC_COLLATE=C ls -l
    total 28
    -rw-rw-r-- 1 vallor vallor 24 May 1 19:59 Makefile
    -rwxrwxr-x 1 vallor vallor 16016 Jan 10 2024 ckarray
    -rw-rw-r-- 1 vallor vallor 169 Jan 10 2024 ckarray.c
    -rw-rw-r-- 1 vallor vallor 63 Jan 10 2024 phrase.txt

    ...which is the case-sensitive sort order.

    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
    OS: Linux 6.14.4 Release: Mint 22.1 Mem: 258G
    "Time wounds all heels..."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli the Bearded@21:1/5 to Scott Dorsey on Sat May 3 20:07:52 2025
    In comp.misc, Scott Dorsey <kludge@panix.com> wrote:
    vallor <vallor@cultnix.org> wrote:
    LC_COLLATE=C ls -l
    (Discovered by logging into my Panix shell and inspecting
    the behavior and settings there.)

    A Panix convention.

    Does it work on linux as well as on the Panix machines?

    The glibc Linux boxen work with that. 'LC_COLLATE=C' seems to mean
    "tradional C behavior". I'm not sure how non-glibc Linux behaves
    (thinking of Alpine). I suspect those don't even need the variable.

    Elijah
    ------
    has been running with LC_COLLATE=C in ~/.profile for many years

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)