From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6857 invoked by alias); 6 May 2016 21:40:58 -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: 38414 Received: (qmail 26531 invoked from network); 6 May 2016 21:40:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Originating-IP: [86.21.161.213] X-Spam: 0 X-Authority: v=2.1 cv=AchMZCjG c=1 sm=1 tr=0 a=oo3MgO7t/4XyXFuSzI3dDQ==:117 a=oo3MgO7t/4XyXFuSzI3dDQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=euoXYd9SczjtWSuu6MQA:9 a=CjuIK1q_8ugA:10 a=z9dJwno5l634igLiVhy-:22 Date: Fri, 6 May 2016 22:35:20 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: Weird issue with pipeviewer and multiple pipes Message-ID: <20160506223520.34b3e3c4@ntlworld.com> In-Reply-To: References: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 3 May 2016 20:56:14 -0700 Bart Schaefer wrote: >On Tue, May 3, 2016 at 6:15 PM, Jaron L Tibbitts III wrote: > > > > [2] + 11459 done echo 1 | > > 11461 suspended (tty output) pv -l -s $(echo 1) | > > 11462 interrupt cat > > I don't know why the $(echo) makes any > difference to it receiving the TTOU in the first place. Actually, it looks like This Can't Possibly Happen, since $(echo 1) is over and done with by the time the pv is started; we've got the output, closed the fd, and waited for the process to finish (by PID). So there is some weird lingering side effect. > All of these also avoid the problem: > > echo 1 | { trap '' TTOU ; pv -p -s $(echo 1) } | cat > echo 1 | pv -p -s $(echo 1) 2>/dev/tty | cat > echo 1 | { x=$(echo 1); pv -p -s $x } | cat Also, a substitution of the form $(