From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1395 invoked by alias); 9 Aug 2011 20:19:29 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29662 Received: (qmail 8729 invoked from network); 9 Aug 2011 20:19:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.171 is neither permitted nor denied by SPF record at ntlworld.com) X-ProxyUser-IP: 86.27.188.118 Date: Tue, 9 Aug 2011 21:19:10 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: How to misplace an entire pipeline Message-ID: <20110809211910.631d6561@pws-pc.ntlworld.com> In-Reply-To: <110808231032.ZM2380@torch.brasslantern.com> References: <110805203111.ZM32508@torch.brasslantern.com> <20110807185002.6a042cab@pws-pc.ntlworld.com> <110807144359.ZM27903@torch.brasslantern.com> <110807210507.ZM28821@torch.brasslantern.com> <20110808192720.380a3ee7@pws-pc.ntlworld.com> <110808231032.ZM2380@torch.brasslantern.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 08 Aug 2011 23:10:32 -0700 Bart Schaefer wrote: > On Aug 8, 7:27pm, Peter Stephenson wrote: > } Subject: Re: How to misplace an entire pipeline > } > } On Sun, 07 Aug 2011 21:05:07 -0700 > } Bart Schaefer wrote: > } > - jobtab[thisjob].stat |= STAT_CURSH|STAT_NOPRINT; > } > + jobtab[thisjob].stat |= STAT_CURSH; > } > + if (!jobtab[thisjob].procs) > } > + jobtab[thisjob].stat |= STAT_NOPRINT; > } > } Looks fairly plausible, anyway. > > Should that be "if (hasprocs(thisjob))" instead, do you think? To a first approximation, the user isn't directly interested in the aux procs, but there might still be some knock-on effect. So until we find otherwise, I would guess not. > So the following hack does the right thing in the case of piping to > true where execbuiltin() has returned, but does not do the right thing > in the case of read. What needs to be tested in place of (!list_pipe) > to determine that the tail of the current pipeline is a simple shell > builtin? I don't think we've remembered that fact, but it's available (as is_builtin) in execcmd(), so could be stored before the builtin is called. What I don't know about is where to put that information (is it as simple as using thisjob?), and what might invalidate it. > In fact even that may not be enough, maybe this needs to know if the > current job is a simple shell builtin -- it might be blocked on a > "while read; do ..." or on a "wait" in the middle of a loop, etc. I suppose it depends on what cases the list_pipe logic would be triggered. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/