zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Daniel Li <dan@tubitv.com>
Cc: zsh-workers@zsh.org
Subject: Re: Modify sort ordering for `ls`
Date: Fri, 18 Aug 2017 16:44:35 -0400	[thread overview]
Message-ID: <20170818204435.GA38284@tower.spodhuis.org> (raw)
In-Reply-To: <CAN_nDg6OHXswqwes9zgFsMPPXecXNSeqM77D4fOsPG1FesgE=g@mail.gmail.com>

On 2017-08-18 at 13:32 -0700, Daniel Li wrote:
> Whereas on Ubuntu, ls -l gives the reverse:
> 
> -rw-rw-r-- 1 ubuntu ubuntu 0 Aug 18 13:22 VeryLongFileNameHelper.scala
> -rw-rw-r-- 1 ubuntu ubuntu 0 Aug 18 13:22 VeryLongFileName.scala

export LC_COLLATE=POSIX

1. The default sort ordering is driven by locale.
2. Zsh can do things about results of stuff driven by zsh, including
   glob expansion.
3. The above is not using zsh glob expansion.
4. How ls(1) works should be documented in its man-page and other than
   via the environment, Zsh can't do anything here.  There's no
   environment variables _we_ can add to _your_ system ls.

Ultimately, if you can't find a locale collation which works for your
purposes, you can dive deep and write your own collation specification.
If your OS allows use of private locale definitions, then these should
work in _all_ locale-aware applications, not just ls(1).

http://pubs.opengroup.org/onlinepubs/009696699/utilities/localedef.html
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/xbd_chap07.html


  parent reply	other threads:[~2017-08-18 21:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 20:32 Daniel Li
2017-08-18 20:34 ` Daniel Li
2017-08-18 20:44 ` Phil Pennock [this message]
2017-08-18 22:24   ` Daniel Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170818204435.GA38284@tower.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=dan@tubitv.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).