Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Tee all output to log file?
- X-seq: zsh-users 15756
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Tee all output to log file?
- Date: Tue, 1 Feb 2011 18:41:26 -0500 (EST)
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
For scripting purposes I occasionally want a way to both record and
display all the output of a script. On several occasions now, I've
looked through the output redirection section of the manual, but I never
come up with quite what I'm looking for.
Essentially, when I want this, I usually want something like:
#!/bin/zsh
(( $+logfile )) && exec |& tee $logfile
Boiled down even further, it's really just this I'm looking for:
exec |& tee logfile
Is there something straightforward that I'm overlooking? Is there a
commonly used utility for this? (`script` comes to mind, but I recall
klunkiness when trying it in the past.)
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author