Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: using parameter expansion sorting flags
- X-seq: zsh-users 16395
- From: Rory Mulvaney <rorymulv@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: using parameter expansion sorting flags
- Date: Thu, 22 Sep 2011 07:23:17 -0500 (CDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:in-reply-to:message-id:references:user-agent :mime-version:content-type; bh=OD1JZvo05KQS8lSDgN1CMJbu3pTFr3QYoj8m4XEUFGs=; b=g/jJou98/SWRCZUsW65ReA8+qNJB1iBxZair9WuzQPI0O+t0eZBZqIfZV1xPQK8Aa+ 8WPDkdrHoSL7Kkvwt0/tY8xmc0bMSRCISDoRLnMlH92eUkstPN5iY7kduaCDDTwUBe/E JZ/hIf6SzEa/AdetIn7YqNJKPlYlzdxS8cyaM=
- In-reply-to: <20110922075936.GE4542@layslair.ath.cx>
- 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
- References: <alpine.DEB.2.00.1109220143300.5262@MyComp.rgm-web.net> <20110922075936.GE4542@layslair.ath.cx>
I see what I was doing wrong now - I had been assigning
PNMFILES2=${(o)PNMFILES} without the parentheses to indicate an array.
I forgot... Thanks!
On Thu, 22 Sep 2011, Anthony Charles wrote:
> Hi,
>
> It works with o and n flags :
>
> % a=( 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)
>
> % print -l $a
> 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
>
> % print -l ${(on)a}
> 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
>
> % print -l ${${(on)a}[2]}
> f.0009.Bbot.pnm
>
> % PNMFILES2=( ${(on)a} )
> % print -l ${PNMFILES2[2]}
> f.0009.Bbot.pnm
>
> --
> Anthony CHARLES
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author