From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id LAA08340 for ; Mon, 15 Jul 1996 11:22:55 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id VAA05427; Sun, 14 Jul 1996 21:06:51 -0400 (EDT) Resent-Date: Sun, 14 Jul 1996 21:06:51 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199607150102.DAA03226@turan.elte.hu> Subject: Re: Another patch to compctl-examples CVS compctl, and a bug? To: schaefer@nbn.com Date: Mon, 15 Jul 1996 03:02:23 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <960713173425.ZM5697@candle.brasslantern.com> from Bart Schaefer at "Jul 13, 96 05:34:22 pm" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"9GrWV2.0.jK1.hcPwn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1643 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > It's now possible to avoid several external processes in generating the > list of CVS-controlled files in the `cvstargets' function. The key is > this wonderful "parameter" (boy, is that misnamed) subsitution: > > "${${${(f@)$({<${pref}CVS/Entries} 2>/dev/null)}#/}%%/*}" There are two problems with that. First I've modified the lexer so that !, [[, { and } are reserved words now. This means that these must be delimited. So {echo} no longer works, { echo } should be used instead. Similarily [[-z $foo]] does not work, [[ -z $foo ]] should be used. The other problem is that this depends on READNULLCMD being cat. $(<...) always works since it is always recognized as a special command substitution. That's why the 2> redirection does not work in that case (but a space between `(' and `<' fixes that problem). > If there's a better way than `for f in ... do echo ... done' to prefix > every element of the resulting array with ${pref}, I'd love to see it. It's simply "${pref}${^${${(f@)$({<${pref}CVS/Entries} 2>/dev/null)}#/}%%/*}" > works fine. However, if no CVS directory exists at all, the above > subsitution prints a newline to the terminal -- which messes up zle. Are you sure that there is not empty element in the reply? The above `parameter expansion' always produces at least one element. Zoltan