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

Re: [14172] |& broken in 4.0.1-pre-3?



On Tue, May 01, 2001 at 08:49:59AM +0000,
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> On May 1,  9:44am, Thomas Köhler wrote:
> }
> } But another question:
> } How do I redirect some fds and still get them to the screen?
> 
> Assuming we're not talking about vim, you do it by redirecting the descriptor
> to itself, like this:
> 
> zsh% foo >&1 >x >y >z

Uhm, that's the trick. Fine :-)

> Remember, though, that multios are processed by what amounts to a background
> `tee' job, so `foo' may finish and give you back a prompt before all the
> output has actually appeared on your terminal.

Not too much of an issue.

> } Of course, for stdout,
> } foo >x >y |tee z
> } works; but how do I get this to work for stderr?
> 
> Same basic idea:
> 
> zsh% foo 2>&1 2>x 2>y 2>z

Well... better yet,
foo 2>&2 2>x 2>y 2>z
works :-)

> Note that 2>& with a file name rather than a following digit will open the
> file twice, giving you two copies of stderr in that file.  I'm not sure
> that's supposed to happen ...

Well, I try to avoid that anyways :-)

Ciao,
Thomas

-- 
Thomas Köhler             Linux without limits: http://linux.s390.org/
Millenux GmbH      http://www.millenux.de/  thomas.koehler@xxxxxxxxxxx
Lilienthalstraße 2                            phone: +49.711.88770.300
D-70825 Stuttgart-Korntal                       fax: +49.711.88770.349



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