From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28849 invoked from network); 17 Nov 2008 16:51:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Nov 2008 16:51:53 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 83952 invoked from network); 17 Nov 2008 16:51:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Nov 2008 16:51:47 -0000 Received: (qmail 1759 invoked by alias); 17 Nov 2008 16:51:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26056 Received: (qmail 1749 invoked from network); 17 Nov 2008 16:51:44 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 17 Nov 2008 16:51:44 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id A209F80524C4 for ; Mon, 17 Nov 2008 17:51:41 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly50d.srv.mailcontrol.com (MailControl) with ESMTP id mAHGpe0o005408 for ; Mon, 17 Nov 2008 16:51:40 GMT Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 17 Nov 2008 16:51:40 +0000 Date: Mon, 17 Nov 2008 16:51:39 +0000 From: Peter Stephenson To: "Zsh Hackers' List" Subject: Re: parse error in process substitution Message-ID: <20081117165139.7051465b@news01> In-Reply-To: <081115201055.ZM13767@torch.brasslantern.com> References: <20081106150224.GA10992@apartia.fr> <081106082517.ZM27477@torch.brasslantern.com> <20081110082152.GA9563@apartia.fr> <20081110142850.0add2680@news01> <20081112105241.40c116d9@news01> <20081113210044.4cea912c@pws-pc> <081115201055.ZM13767@torch.brasslantern.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Nov 2008 16:51:40.0041 (UTC) FILETIME=[C31BB790:01C948D4] X-Scanned-By: MailControl A_08_51_00 (www.mailcontrol.com) on 10.68.0.160 X-Virus-Scanned: ClamAV 0.92.1/8642/Mon Nov 17 05:01:08 2008 on bifrost X-Virus-Status: Clean On Sat, 15 Nov 2008 20:10:55 -0800 Bart Schaefer wrote: > One last item ... perhaps you can explain what's going on here: > > schaefer[518] cat <<(echo foo)what? > foo > schaefer[519] > > I'm not sure exactly what I expected, but that wasn't it. This turns it back into an error with a specific message. Index: Doc/Zsh/expn.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v retrieving revision 1.99 diff -u -r1.99 expn.yo --- Doc/Zsh/expn.yo 17 Nov 2008 16:11:30 -0000 1.99 +++ Doc/Zsh/expn.yo 17 Nov 2008 16:47:07 -0000 @@ -362,6 +362,8 @@ commonly occurring strings and patterns, the last form must occur at the start of a command argument, and the forms are only expanded when first parsing command or assignment arguments. +Process substitutions may be used following redirection operators; in this +case, the substitution must appear with no trailing string. In the case of the tt(<) or tt(>) forms, the shell runs the commands in var(list) asynchronously. If the system supports the tt(/dev/fd) Index: Src/exec.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/exec.c,v retrieving revision 1.161 diff -u -r1.161 exec.c --- Src/exec.c 13 Nov 2008 21:18:14 -0000 1.161 +++ Src/exec.c 17 Nov 2008 16:47:07 -0000 @@ -3773,9 +3773,14 @@ int pipes[2], out = *cmd == Inang; pid_t pid; struct timeval bgtime; + char *ends; - if (!(prog = parsecmd(cmd, NULL))) + if (!(prog = parsecmd(cmd, &ends))) return -1; + if (*ends) { + zerr("invalid syntax for process substitution in redirection"); + return -1; + } mpipe(pipes); if ((pid = zfork(&bgtime))) { zclose(pipes[out]); -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070