From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25891 invoked from network); 4 Oct 2006 20:10:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Oct 2006 20:10:51 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 9437 invoked from network); 4 Oct 2006 20:10:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Oct 2006 20:10:38 -0000 Received: (qmail 28645 invoked by alias); 4 Oct 2006 20:10:30 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10783 Received: (qmail 28560 invoked from network); 4 Oct 2006 20:10:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Oct 2006 20:10:28 -0000 Received: (qmail 6712 invoked from network); 4 Oct 2006 20:10:23 -0000 Received: from dan.emsphone.com (199.67.51.101) by a.mx.sunsite.dk with SMTP; 4 Oct 2006 20:10:21 -0000 Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.6) id k94KAIi9027370; Wed, 4 Oct 2006 15:10:18 -0500 (CDT) (envelope-from dan) Date: Wed, 4 Oct 2006 15:10:18 -0500 From: Dan Nelson To: "Larry P. Schrof" Cc: zsh-users@sunsite.dk Subject: Re: Question on array processing. Message-ID: <20061004201018.GH54791@dan.emsphone.com> References: <20061004200025.GA3092@lucien.blight.com> <20061004200759.GG54791@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061004200759.GG54791@dan.emsphone.com> X-OS: FreeBSD 6.1-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.13 (2006-08-11) In the last episode (Oct 04), Dan Nelson said: > In the last episode (Oct 04), Larry P. Schrof said: > > I'm tring to do something like: > > > > > str="these:are:some:words" > > > echo ${str[(ws:::)2]} > > zsh: bad math expression: operand expected at `::)2' > > > > I've also tried :":":, :\::, and :':': - none of those work. > > > > Is this a small flaw / hole in zsh's functionality? > > You can use any character as a delimiter, not just a colon: > > $ str="these:are:some:words" > $ echo ${str[(ws/:/)2]} > are Forgot to include the documentation that mentions this: The following flags (except p) are followed by one or more arguments as shown. Any character, or the matching pairs `(...)', `{...}', `[...]', or `<...>', may be used in place of a colon as delimiters, but note that when a flag takes more than one argument, a matched pair of delimiters must surround each argument. -- Dan Nelson dnelson@allantgroup.com