Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
using parameter expansion sorting flags
- X-seq: zsh-users 16392
- From: Rory Mulvaney <rorymulv@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: using parameter expansion sorting flags
- Date: Thu, 22 Sep 2011 01:46:20 -0500 (CDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:user-agent:mime-version :content-type; bh=dqNN/gNhVKH4BEGHy3J76vyhKGV86mUthFdZ2Hx0LCA=; b=TaO0XTfn6Nh/4/CQy50cmyT6UME0PaLJmwn3yYssnh083QVZbNH7bCNa65cpR8DLlQ W9H8jLPRaG+pgyh6ABhnIx10FRDU3AKLF4C9yEPWB4aRbjUrlXJK0iOnRLmraFRg/iuw i/5y7BJDxIgseqYRfPRd1+OkkrMG09QIeAutc=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hello,
I have a few filenames that I put into an array with:
PNMFILES=( f.*.{Atop,Bbot}.pnm )
the ordered contents of this array become:
f.0009.Atop.pnm f.0010.Atop.pnm f.0011.Atop.pnm f.0012.Atop.pnm
f.0009.Bbot.pnm f.0010.Bbot.pnm f.0011.Bbot.pnm
Now I can't figure out how to order them in an array, using the parameter
expansion sorting flags n and o, as:
f.0009.Atop.pnm f.0009.Bbot.pnm f.0010.Atop.pnm f.0010.Bbot.pnm
f.0011.Atop.pnm f.0011.Bbot.pnm f.0012.Atop.pnm
Also I'd like the resulting resorted array PNMFILES2 to be such that:
echo ${PNMFILES2[2]}
yields:
f.0009.Bbot.pnm
rather than some single character.
Thanks and regards again,
Rory
Messages sorted by:
Reverse Date,
Date,
Thread,
Author