From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2098 invoked by alias); 18 Aug 2017 21:02:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41571 Received: (qmail 13107 invoked by uid 1010); 18 Aug 2017 21:02:46 -0000 X-Qmail-Scanner-Diagnostics: from mx.spodhuis.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(94.142.241.89):SA:0(-4.2/5.0):. Processed in 2.443619 secs); 18 Aug 2017 21:02:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: zsh-workers+phil.pennock@spodhuis.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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; Date: Fri, 18 Aug 2017 16:44:35 -0400 From: Phil Pennock To: Daniel Li Cc: zsh-workers@zsh.org Subject: Re: Modify sort ordering for `ls` Message-ID: <20170818204435.GA38284@tower.spodhuis.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc 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