${(o)…}: Sort in ascending order

(o) sorts in ascending order. It’s the default sort order of flags a, i, n, and -.

O is the opposite and sets descending sort order.

Examples

Lexical, case-sensitive sorting in ascending order
1
2
declare data=(z X A a)
echo "Sorted with default settings: " ${(o)data}
Output:
1
Sorted with default settings:  a A X z
BashSupport Pro 是一款支持 o** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款