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

Multiple output redirection in zsh script.



Hi!

Is it possible to switch zsh output to file *and* terminal (the way tee
does) and then back? I have tried

exec > /dec/fd/1 > /some/output/file
date
exec > /dev/fd/1
date

After first exec output is really redirected to both terminal and file.
But I have found that it is not possible any more to close file!!! that
is, second exec does nothing - output is still directed to both.

Yes, I know at least two means to do the same; but I really would prefer
the above method, because otherweise
  I have to use { ...... } > .. > .. construct. It potentially means
  many levels of { } bracketing, which I would like to avoid.

thanks in advance

greetings

-------------------------------------------------------------------------
Andrej Borsenkow 		Fax:   +7 (095) 252 01 05
SNI ITS Moscow			Tel:   +7 (095) 252 13 88

NERV:  borsenkow.msk		E-Mail: borsenkow.msk@xxxxxx
-------------------------------------------------------------------------





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