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 5094 invoked from network); 3 Jul 2020 18:36:16 -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:36:16 -0000 Received: (qmail 1980 invoked by alias); 3 Jul 2020 18:36:09 -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: 24977 Received: (qmail 10621 invoked by uid 1010); 3 Jul 2020 18:36:09 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f50.google.com 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(209.85.210.50):SA:0(-1.9/5.0):. Processed in 1.821211 secs); 03 Jul 2020 18:36:09 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.210.50 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/vCFLBcuDG04Oo2g8GyN30yA42Pjt7ejlxrUh93p0r4=; b=ILo4UQmCM1/3mAiBtQOhLZHboRSvZKflA3teXFFbuAVqMkUnyLWDAkwZEpM4DyYYmY EmEvoMV35jeRIzD+UJMQX5E/PRNpiNSzch/XffC7COkO+Z09VIWis/NNDE5bTkRAJWpy Z4pfhXuUWiS3rcE6ky9OHXJX44SY7GFp4zVodyYnR3GnNupcIgRTNqivf+7M9KeadlXb qm608ApEpj7Q6fdwpWDhsK828gHW9jCQoYZB03RxAOlFq8yDM9bTY06Fe/UX2L/czTfz UVWBLwUmvxQzVlAQULd7dFK3y5irHKBs2mFbQey5i5kWzr2m26L2+B7Zh36+ULmTGVzv iugg== X-Gm-Message-State: AOAM530diKPg0o2gqJ3tYZqWs0Q27qCVIPbUOdLCr4Xf0uftOxniZ61Y krmGv98zm3uVU+ObnZC5Lm2OHbufPSJaqlM/8urVFXVK X-Google-Smtp-Source: ABdhPJx4WZlR6zZ2SeujlwTVgkqq3UHgGQ/G1iTfETlnDh7UN9qOp53HvcCgIfJ3hzDwKSvguPDhLPOj2AkyT+Jdvo4= X-Received: by 2002:a9d:37f6:: with SMTP id x109mr34058940otb.229.1593801334035; Fri, 03 Jul 2020 11:35:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 3 Jul 2020 11:35:23 -0700 Message-ID: Subject: Re: How to impose a numeric sort on negative numbers? To: Lewis Butler Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Fri, Jul 3, 2020 at 11:13 AM Lewis Butler wrote: > > arr=( -1A -2b -3B 0 1A 2C 3B ); print -l ${(on)arr} | sort -h > > Or is that cheating? Well, it's sort of cheating, but it's not correct either, because "1G" would sort after "1K". I think you want "sort -n" rather than -h. And if you're piping to sort anyway, there's no reason to use (on) first.