Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to impose a numeric sort on negative numbers?
- X-seq: zsh-users 24967
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: How to impose a numeric sort on negative numbers?
- Date: Wed, 1 Jul 2020 20:02:58 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAKc7PVB7kJ_n7tvrC2Xog=XuhYxvE5iEUx9dnK5oOGBZijbTOg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVB7kJ_n7tvrC2Xog=XuhYxvE5iEUx9dnK5oOGBZijbTOg@mail.gmail.com>
- Sender: zsh-users@xxxxxxx
On 7/1/20, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Hi,
> arr=( -1A -2b -3B 0 1A 2C 3B )
> print -rl ${(on)arr}
>
> Output:
> 0
> 1A
> -1A
> -2b
> 2C
> 3B
> -3B
>
> So it's not "correct". How to sort from -3 to 2?
Works fine here,
% arr=( -1A -2b -3B 0 1A 2C 3B )
% print -rl ${(on)arr}
-1A
-2b
-3B
0
1A
2C
3B
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author