Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Multios redirection while keeping current descriptors, and exec
- X-seq: zsh-users 27750
- From: John Covici <covici@xxxxxxxxxxxxxx>
- To: Zach Riggle <zachriggle@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Multios redirection while keeping current descriptors, and exec
- Date: Tue, 10 May 2022 14:49:57 -0400
- Archived-at: <https://zsh.org/users/27750>
- In-reply-to: <CAMP9c5mqbBiyW_Qo2cU-sn+TRhn6KE6WmJz9ujN=cPwTU2j1Pw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Organization: Covici Computer Systems
- References: <CAMP9c5mqbBiyW_Qo2cU-sn+TRhn6KE6WmJz9ujN=cPwTU2j1Pw@mail.gmail.com>
- Reply-to: covici@xxxxxxxxxxxxxx
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