From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-users@sunsite.auc.dk
Subject: Re: pipe on stderr
Date: Thu, 15 Jul 1999 18:08:45 +0200 [thread overview]
Message-ID: <9907151608.AA29292@ibmth.df.unipi.it> (raw)
In-Reply-To: "Didier Verna"'s message of "15 Jul 1999 18:23:29 DFT." <qyjg12pnapq.fsf@metheny.enst.fr>
Didier Verna wrote:
> I've only recently discovered that there's no simple way, in any
> shell, to pipe stderr on another process. As you can write `foo 2> foo.err',
> wouldn't it be nice to be able to write `foo 2| bar' ?
Trouble is, it gets into quite serious trouble with existing syntax, since
you don't need a space before the pipe --- think about
echo 2| foo
so although it could be an option there's probably still too much scope for
confusion.
As you may already have discovered, you can swap file descriptors:
echo foo 3>&1 1>&2 2>&3 | sed 's/foo/bar/'
which has the effect you want provided 1 and 2 were originally going to the
same place, i.e. what used to be 1 still goes there but what used to be 2
now goes to the pipe. But agree it's not simple (and in zsh you have to
`unsetopt multios').
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
next prev parent reply other threads:[~1999-07-15 16:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-15 16:23 Didier Verna
1999-07-15 16:08 ` Peter Stephenson [this message]
1999-07-16 4:11 ` Geoff Wing
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=9907151608.AA29292@ibmth.df.unipi.it \
--to=pws@ibmth.df.unipi.it \
--cc=zsh-users@sunsite.auc.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).