From: Wayne Davison <wayned@users.sourceforge.net>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: Piping stderr (was Re: Two bug reports)
Date: Sun, 24 Mar 2002 01:01:04 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.33L2.0203240032180.20227-100000@phong.blorf.net> (raw)
In-Reply-To: <1020323224514.ZM29171@candle.brasslantern.com>
On Sat, 23 Mar 2002, Bart Schaefer wrote:
> On Mar 23, 1:18pm, Wayne Davison wrote:
> } I'm wondering if it would be nice to create a syntax for piping just
> } stderr?
>
> You mean, other than `2>>(...)'?
Uh ... Yeah, Yeah. That's what I meant. _Other_ than that. :-)
(I had apparently neglected to find that syntax when I was searching
the zsh man page.)
So, I suppose that Peter's reply to David Hughes could be ammended to
say that in addition to turning off multios, he could change this
command:
/bin/sh -c 'echo out; echo err >&2' 2>&1 >/dev/null | cat
into this one:
/bin/sh -c 'echo out; echo err >&2' >/dev/null 2>>(cat)
The bad thing about this idiom is that it doesn't wait for "cat" to
finish before moving on. If we implemented my proposed stderr-pipe
syntax, the following command wouldn't have that problem:
/bin/sh -c 'echo out; echo err >&2' >/dev/null 2>|& cat
> Hmm. `|&' is short for `2>&1 |'. What would the new syntax be short
> for?
It wouldn't be short for anything. Instead "|" would become short for
"1>|&". The construct simply means "take the numbered file handle and
pipe it to stdin of the following command."
> The problem being that in order to pipe "just stderr" you have
> to dispose of stdout somehow.
No, stdout doesn't need to be affected at all. If the user wants stdout
to go somewhere other than the default, it can be redirected explicitly
(as I did above).
..wayne..
next prev parent reply other threads:[~2002-03-24 15:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-22 12:24 Two bug reports: alias/function disagreements; incorrect redirection David Hughes
2002-03-22 12:41 ` Peter Stephenson
2002-03-23 21:18 ` Piping stderr (was Re: Two bug reports) Wayne Davison
2002-03-23 22:45 ` Bart Schaefer
2002-03-23 23:47 ` Multios again (Re: Piping stderr (was Re: Two bug reports)) Bart Schaefer
2002-03-24 9:01 ` Wayne Davison [this message]
2002-03-24 16:47 ` Piping stderr (was Re: Two bug reports) Borsenkow Andrej
2002-03-24 19:02 ` Bart Schaefer
2002-03-24 19:09 ` Bart Schaefer
2002-03-24 19:50 ` PATCH: (Doc) " Bart Schaefer
2002-03-25 0:17 ` Wayne Davison
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=Pine.LNX.4.33L2.0203240032180.20227-100000@phong.blorf.net \
--to=wayned@users.sourceforge.net \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/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).