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

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

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

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.

} 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

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 ...

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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