Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: using parameter expansion sorting flags



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