zsh-workers
 help / color / mirror / code / Atom feed
From: Philippe Troin <phil@fifi.org>
To: Kartik Agaram <akkartik@gmail.com>, zsh-workers@zsh.org
Subject: Re: pipelines transmitting data even after redirecting stdout
Date: Thu, 30 May 2019 21:33:17 -0700	[thread overview]
Message-ID: <dabe8f3b84aa58914282958467f3bf22f97306ed.camel@fifi.org> (raw)
In-Reply-To: <CANOtCLXNrgX+-wds6gAdm0LRJxZGUKJc3ZVOeVJhCGBGAaxdTw@mail.gmail.com>

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.


      reply	other threads:[~2019-05-31  4:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  3:35 Kartik Agaram
2019-05-31  4:33 ` Philippe Troin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dabe8f3b84aa58914282958467f3bf22f97306ed.camel@fifi.org \
    --to=phil@fifi.org \
    --cc=akkartik@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).