${(a)…}: Sort array by index

Sort an array in index order. This is most useful together with the O flag to reverse the sort order.

Examples

Print an indexed array in reverse order
1
2
values=(a b c)
echo ${(aO)values}
Output:
1
c b a
BashSupport Pro 是一款支持 a** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款