From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19858 invoked from network); 21 Jul 2003 09:59:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 21 Jul 2003 09:59:54 -0000 Received: (qmail 24376 invoked by alias); 21 Jul 2003 09:59:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18876 Received: (qmail 24364 invoked from network); 21 Jul 2003 09:59:46 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 21 Jul 2003 09:59:46 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 21 Jul 2003 9:59:46 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.cambridgesiliconradio.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Mon, 21 Jul 2003 10:59:06 +0100 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 21 Jul 2003 10:58:26 +0100 To: zsh-workers@sunsite.dk Subject: Re: local variable assignment and pipelines? In-reply-to: "Dan Nelson"'s message of "Fri, 18 Jul 2003 16:58:01 CDT." <20030718215801.GB37697@dan.emsphone.com> Date: Mon, 21 Jul 2003 10:59:42 +0100 Message-ID: <17336.1058781582@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 21 Jul 2003 09:58:26.0731 (UTC) FILETIME=[A14757B0:01C34F6E] Dan Nelson wrote: > a=1 | echo $a -> prints "1" on zsh, prints nothing on ash,pdksh,bash It's an inevitable but unintended side effect of the way some substitutions are done by the shell before it forks. The list given in subst.c is this one. /* Do substitutions before fork. These are: * - Process substitution: <(...), >(...), =(...) * - Parameter substitution * - Command substitution * Followed by * - Quote removal * - Brace expansion * - Tilde and equals substitution */ My guess is this is left undefined by POSIX etc. The stuff on pipelines is fairly terse, but there might be something elsewhere since I didn't look all that closely. Where you would not want this to happen, and it doesn't, is if the assignment immediately precedes a command. pws ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************