Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to impose a numeric sort on negative numbers?
- X-seq: zsh-users 24965
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: How to impose a numeric sort on negative numbers?
- Date: Wed, 1 Jul 2020 19:45:03 +0200
- 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
- Sender: zsh-users@xxxxxxx
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?
--
Sebastian Gniazdowski
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author