From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3283 invoked from network); 14 Apr 2004 01:59:07 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Apr 2004 01:59:07 -0000 Received: (qmail 11401 invoked by alias); 14 Apr 2004 01:58:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7349 Received: (qmail 11364 invoked from network); 14 Apr 2004 01:58:55 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 14 Apr 2004 01:58:55 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 14 Apr 2004 1:58:55 -0000 Received: (qmail 25670 invoked from network); 14 Apr 2004 01:58:54 -0000 Received: from wbar3.sjo1-4-11-009-147.sjo1.dsl-verizon.net (HELO candle.brasslantern.com) (4.11.9.147) by a.mx.sunsite.dk with SMTP; 14 Apr 2004 01:58:52 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i3E1wok21527 for zsh-users@sunsite.dk; Tue, 13 Apr 2004 18:58:50 -0700 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <040413185850.ZM21526@candle.brasslantern.com> Date: Tue, 13 Apr 2004 18:58:50 -0700 In-Reply-To: <20040413171443.GA3850@DervishD> Comments: In reply to DervishD "Re: Subscripting without temporaries" (Apr 13, 7:14pm) References: <20040413120053.GA4420@DervishD> <040413082948.ZM20696@candle.brasslantern.com> <20040413171443.GA3850@DervishD> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Zsh Users Subject: Re: Subscripting without temporaries MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: **** X-Spam-Status: No, hits=4.7 required=6.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_NJABL,RCVD_IN_NJABL_DIALUP,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 4.7 On Apr 13, 7:14pm, DervishD wrote: > Hi Bart :) 'Lo. > 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. schaefer[228] array=( "this text [that text] those texts" array> "more text [less text] some text" array> "any text [other text] neither text" ) schaefer[229] print ${array[2][(r)\[,(R)\]]} [less text] 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.