From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id e6fad485 for ; Fri, 31 May 2019 04:34:03 +0000 (UTC) Received: (qmail 13469 invoked by alias); 31 May 2019 04:33:52 -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: List-Unsubscribe: X-Seq: 44384 Received: (qmail 29380 invoked by uid 1010); 31 May 2019 04:33:52 -0000 X-Qmail-Scanner-Diagnostics: from granite.fifsource.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25461. spamassassin: 3.4.2. Clear:RC:0(173.255.216.206):SA:0(-1.9/5.0):. Processed in 1.139101 secs); 31 May 2019 04:33:52 -0000 X-Envelope-From: phil@fifi.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at fifi.org designates 173.255.216.206 as permitted sender) Message-ID: Subject: Re: pipelines transmitting data even after redirecting stdout From: Philippe Troin To: Kartik Agaram , zsh-workers@zsh.org Date: Thu, 30 May 2019 21:33:17 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit On Thu, 2019-05-30 at 20:35 -0700, Kartik Agaram wrote: > This command works as expected: > > % echo abc > /dev/null > % # no output > > However, adding another pipestage to it is unexpected: > > % echo abc > /dev/null |cat > abc # whoa! > > If I redirect stdout to a file I seem to get some `tee`-like behavior for free: > > % echo abc >x |cat > abc > % cat x > abc > > Is this somehow expected behavior? Yes, it's a feature called multios, check the zsh manpage MULTIOS section for details or http://zsh.sourceforge.net/Doc/Release/Redirection.html#Multios Phil.