Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Modify sort ordering for `ls`
- X-seq: zsh-workers 41571
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Daniel Li <dan@xxxxxxxxxx>
- Subject: Re: Modify sort ordering for `ls`
- Date: Fri, 18 Aug 2017 16:44:35 -0400
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201708; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fOtc3Rjwt/gTK+avLR9pLVwmYvarRm+X1HtUoEVyg0A=; b=TRH+b3yvfeoEXYj9Z9hQoJ4bH9 zihARcW3NxHjzCEozzxLF8hu+RLayLqOJfkVbjKwCwhT5VCmPu3xNJhYu5tOHGhs+Z8fcAJ/z/dXB CM29lSMTIZTVvwN0/P8ajXZgcBop6ECNWa5wbnf/6Bodp8FuwB/7ivGTFN2Hb/MTg90eYfRkpxDEO nBPeMHJsO2/y5zq9p5xWjNcVS03O;
- In-reply-to: <CAN_nDg6OHXswqwes9zgFsMPPXecXNSeqM77D4fOsPG1FesgE=g@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc
- References: <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author