Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Subscripting without temporaries
- X-seq: zsh-users 7350
- From: DervishD <raul@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Subscripting without temporaries
- Date: Wed, 14 Apr 2004 18:13:13 +0200
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <040413185850.ZM21526@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Pleyades
- References: <20040413120053.GA4420@DervishD> <040413082948.ZM20696@xxxxxxxxxxxxxxxxxxxxxxx> <20040413171443.GA3850@DervishD> <040413185850.ZM21526@xxxxxxxxxxxxxxxxxxxxxxx>
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