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

Re: Multios redirection while keeping current descriptors, and exec



Why not use the script command instead?

On Tue, 10 May 2022 14:20:59 -0400,
Zach Riggle wrote:
> 
> [1  <text/plain; UTF-8 (7bit)>]
> Hello all!
> 
> Is there a simpler way to additionally log stdout/stderr to a file, while
> keeping the existing one?
> 
>     { echo stdout; >&2 echo stderr } > /tmp/log > /dev/tty 2> /tmp/err
> 2>/dev/tty
> 
> Will log stdout to stdout and /tmp/log, for example.
> 
> Specifically, I want to be able to do this for the remainder of the process
> via "exec".  The goal is to have an interactive stdio like normal, but also
> log all stdout / stderr to a log file.
> 
> *Zach Riggle*
> [2  <text/html; UTF-8 (quoted-printable)>]

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici wb2una
         covici@xxxxxxxxxxxxxx




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