From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2851 invoked from network); 3 Jul 2020 18:13:17 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 3 Jul 2020 18:13:17 -0000 Received: (qmail 7087 invoked by alias); 3 Jul 2020 18:13:07 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: Sender: zsh-users@zsh.org X-Seq: 24976 Received: (qmail 6730 invoked by uid 1010); 3 Jul 2020 18:13:06 -0000 X-Qmail-Scanner-Diagnostics: from mail.covisp.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25857. spamassassin: 3.4.4. Clear:RC:0(65.121.55.42):SA:0(-2.6/5.0):. Processed in 1.218514 secs); 03 Jul 2020 18:13:06 -0000 X-Envelope-From: lbutler@covisp.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at covisp.net designates 65.121.55.42 as permitted sender) From: Lewis Butler Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: How to impose a numeric sort on negative numbers? Date: Fri, 3 Jul 2020 12:12:26 -0600 References: To: Zsh Users In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3645.0.6.2.3) X-Qmail-Scanner-2.11: added fake MIME-Version header MIME-Version: 1.0 > On 01 Jul 2020, at 12:07, Sebastian Gniazdowski = wrote: >=20 > On Wed, 1 Jul 2020 at 20:03, Mikael Magnusson = wrote: >=20 >> On 7/1/20, Sebastian Gniazdowski wrote: >>> Hi, >>> arr=3D( -1A -2b -3B 0 1A 2C 3B ) >>> print -rl ${(on)arr} >>>=20 >>> Output: >>> 0 >>> 1A >>> -1A >>> -2b >>> 2C >>> 3B >>> -3B >>>=20 >>> So it's not "correct". How to sort from -3 to 2? >>=20 >> Works fine here, >> % arr=3D( -1A -2b -3B 0 1A 2C 3B ) >> % print -rl ${(on)arr} >> -1A >> -2b >> -3B >> 0 >> 1A >> 2C >> 3B > It's weird that it's different - could you share `allopt' output? >=20 > And it's not correct - -1 is before -3, etc. arr=3D( -1A -2b -3B 0 1A 2C 3B ); print -l ${(on)arr} | sort -h Or is that cheating? --=20 =C9=B9=D7=9F=CA=87nq=D7=9F tel:+1.303.219.0564