Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

pipelines transmitting data even after redirecting stdout



In the rest of this message I'm running within a zsh sub-process
without any dotfiles or inherited environment variables:

env -i zsh -f

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? I've tested it on the following
systems and gotten identical results:

1. zsh 5.7.1 (x86_64-apple-darwin18.2.0) on Mac OS 10.14.5
2. zsh 5.4.2 on Ubuntu 18.04

(Please explicitly include my email address in responses.)

Thank you,
Kartik
http://akkartik.name/about



Messages sorted by: Reverse Date, Date, Thread, Author