From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4176 invoked from network); 14 Jun 1999 15:15:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Jun 1999 15:15:54 -0000 Received: (qmail 15149 invoked by alias); 14 Jun 1999 15:15:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6622 Received: (qmail 15097 invoked from network); 14 Jun 1999 15:15:00 -0000 Message-Id: <9906141446.AA40350@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk Subject: Re: Parameter exansion, correction and small patch In-Reply-To: ""Kiddle, Oliver""'s message of "Mon, 14 Jun 1999 13:52:47 DFT." <4FBF540FF16FD1119D9600A0C94B2B51F29E83@napier.logica.co.uk> Date: Mon, 14 Jun 1999 16:46:22 +0200 From: Peter Stephenson "Kiddle, Oliver" wrote: > Two questions: > > First, how do I take the output of a command in $(...) and use the parameter > expansion flags to split the output into an array for each line. I'm sure > I've done this before but can't get it to work anymore. I've tried most > things I can think of without success. For example: > echo ${${(f)$(ps)}% *} > I would expect this to apply the '% *' substitution for each line of the > output of ps but it does it for all the lines combined. The key problem is with quoting. We just introduced a tweak so that you can now do echo ${${(f)"$(ps)"}% *} since an unquoted $(ps) does word-splitting on all spaces. The traditional way of doing this was echo "${(@)${(@f)$(ps)}% *}" but that's more cumbersome. > Second, correction seems to be applied when I declare a function which can > be annoying. e.g. > zsh -f > setopt correct > les() { > zsh: correct 'les' to 'els' [nyae]? n > function> > > You might consider this to be a bug but if not, is there any way of > preventing it? `correct' isn't all that flexible at the moment. There ought to be a way of fixing it internally. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy