Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how to pipe to stdout and stderr
- X-seq: zsh-users 6919
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: how to pipe to stdout and stderr
- Date: Wed, 17 Dec 2003 20:13:00 -0600
- In-reply-to: <20031218001201.GA27866@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20031218001201.GA27866@xxxxxxxxx>
In the last episode (Dec 18), Andy Spiegl said:
> Maybe I'm just too tired right now, but I can't find the solution how to
> pipe the standard output and standard error to 2 different programs.
>
> Example:
> program foo (prints to stdout and stderr)
> program bar1 should receive only stdout
> program bar2 should receive only stderr
>
> How can I do this? Someone knows how to do that in bash, too?
It's a little tricky since regular pipes are linear. Zsh does let you
redirect to commands though:
% ( echo stdout ; echo 1>&2 stderr ) > >(tr a-z A-Z) 2> >(tr a-z b-za)
tuefss
STDOUT
%
See the zsh manpage, under the heading "PROCESS SUBSTITUTION".
--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author