Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: capturing output of a script requiring answers to prompts
- X-seq: zsh-users 9105
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: capturing output of a script requiring answers to prompts
- Date: Mon, 18 Jul 2005 11:27:14 -0700
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <5c9nd157fcj924v4fdcjlesm9fvq7c5lb6@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <5c9nd157fcj924v4fdcjlesm9fvq7c5lb6@xxxxxxx>
On Mon, Jul 18, 2005 at 01:52:51PM +0100, zzapper wrote:
> How can I capture the output of a script requiring answers to prompts.
The best way to capture the full output of an interactive session is
using the "script" utility (which comes with most unix-like operating
systems):
script output.txt
That requires you to run your SCRIPT-FILE from inside the subshell and
then "exit". Alternately, if your version of "script" is new enough:
script -c ./SCRIPT-FILE output.txt
The zsh-specific way to output data to both the terminal and a file is
to use multi-IO:
./SCRIPT-FILE >&1 >output.txt
However, that doesn't capture what the user types.
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author