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

Re: Subscripting without temporaries



    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> > I tried the same using more or less what you suggests below, but I
> > didn't get far because I cannot do $array[EXP][Whatever] (well,
> > namely I was trying ${array[10]}[1,8], but zsh told me 'no matches
> > found').
> Heh.  You *can* do ${array[EXP][Whatever]},
> or you can do ${${array[EXP]}[Whatever]},
> but you can't do what you said you tried.

    S**t, how embarrasing... I didn't even try those two
combinations. Well, that way I don't need a temporary.

> Also there was a bug until recently where if EXP is a negative number,
> then the result of $array[EXP] is still an array rather than a string,
> so then the [Whatever] fails to slice the string.

    I'm planning to upgrade to Zsh 4.2.x as soon as the next version
is releases, so I hope I don't get bite by that bug in the interim.

    Thanks a LOT for your help :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/



Messages sorted by: Reverse Date, Date, Thread, Author