bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redirecting pipes?


From: Paul Jarc
Subject: Re: Redirecting pipes?
Date: Mon, 21 Oct 2002 01:09:56 -0400
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu)

"Eric S. Raymond" <esr@thyrsus.com> wrote:
> Paul Jarc <prj@po.cwru.edu>:
>> { xsltproc "$tmpfile" 2>&1 >&3 | sed -e ":$tmpfile:s::foobar.xml:" } 3>&1
>
> Hm.  Are you sure that shouldn't read  2>&1 >&3 ?

That's what I wrote, and what I intended.

> It looks like you're directing stderr to fd 1, then directing fd1 to
> fd3

Right.  At this point, 1 is the pipe, so that's where stderr should
go.  3 is a copy of 1 from outside the pipe, so that's where stdout
goes to keep it from going through the pipe.

> And I suspect that last 3>&1 ought to read 3>&2.

It probably wouldn't matter; 2 and 1 are probably the same outside the
pipe.  But you said you wanted xsltproc's stdout to be undisturbed.
To make that happen even when 2  and 1 are different outside the pipe,
then it should be as I wrote it above.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]