Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Tee all output to log file?
- X-seq: zsh-workers 28690
- From: ZyX <zyx.vim@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Tee all output to log file?
- Date: Wed, 2 Feb 2011 08:04:28 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:reply-to:to:subject:date:user-agent :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=hU1Ay92e9GKDD9oGZipYYJ9xAUb6U02ZHGq7/hGByDI=; b=gpGjHJmXnQLEggZgLXWNV3ewIYaDm4mixx+1chMiRPmvvhjzys20AQuQUs2XXE68NQ fNpXEWk5bszZiN+YPkfPHBxkVSmk6SJZBnFeJsHZSnR9jbA3j74vkgdONGjY7vnxgSVm 8jmCzkutgpgv1L5I/4/mOhAi0WVV1y4n1zlpA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=aEVuxosFxFs9532fkNm8dbTpPw3PUhuUXN+8ACXbsZcQ93NRgnh6n4I6YokHxv1ZAH bkM8uRVdIy5sqiRQsIWixINm+CvmZ4JV5wCzG5LrSzsetFms+XF9E2kCAS+o313idUp3 MgBk+/LV5dpCKPkRr6c2/fEetilck5ccLrZHk=
- In-reply-to: <alpine.LNX.2.01.1102011836170.2792@hp>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <alpine.LNX.2.01.1102011836170.2792@hp>
- Reply-to: zyx.vim@xxxxxxxxx
Reply to message «Tee all output to log file?»,
sent 02:41:26 02 February 2011, Wednesday
by Benjamin R. Haskell:
> 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.)
If you don't like script, maybe you should try screen:
(( $+logfile )) && \
exec screen -L -c =(echo "logfile $logfile") -m -S script-$0 $0 $@
(probably needs some escaping of $logfile).
Does anybody know, why it does not work when I start screen in detached mode?
Original message:
> 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.)
Attachment:
signature.asc
Description: This is a digitally signed message part.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author