zsh-users
 help / color / mirror / code / Atom feed
* capturing output of a script requiring answers to prompts
@ 2005-07-18 12:52 zzapper
  2005-07-18 15:54 ` zzapper
  2005-07-18 18:27 ` Wayne Davison
  0 siblings, 2 replies; 4+ messages in thread
From: zzapper @ 2005-07-18 12:52 UTC (permalink / raw)
  To: zsh-users

Hi,
How can I capture the output of a script requiring answers to prompts.

eg a script with requires a y/n answer

-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: capturing output of a script requiring answers to prompts
  2005-07-18 12:52 capturing output of a script requiring answers to prompts zzapper
@ 2005-07-18 15:54 ` zzapper
  2005-07-18 18:27 ` Wayne Davison
  1 sibling, 0 replies; 4+ messages in thread
From: zzapper @ 2005-07-18 15:54 UTC (permalink / raw)
  To: zsh-users

Hi,
'Spose what I'd like to do is tee off standard out, run the script responding to yes/nos etc and
then view the trace. What I don't want to do is to kludge the script
-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: capturing output of a script requiring answers to prompts
  2005-07-18 12:52 capturing output of a script requiring answers to prompts zzapper
  2005-07-18 15:54 ` zzapper
@ 2005-07-18 18:27 ` Wayne Davison
  2005-07-18 19:29   ` zzapper
  1 sibling, 1 reply; 4+ messages in thread
From: Wayne Davison @ 2005-07-18 18:27 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

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..


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: capturing output of a script requiring answers to prompts
  2005-07-18 18:27 ` Wayne Davison
@ 2005-07-18 19:29   ` zzapper
  0 siblings, 0 replies; 4+ messages in thread
From: zzapper @ 2005-07-18 19:29 UTC (permalink / raw)
  To: zsh-users

On Mon, 18 Jul 2005 11:27:14 -0700,  wrote:

>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..
This last one did the trick, curiously it didn't display the o/p of the select clause

-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-18 19:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-18 12:52 capturing output of a script requiring answers to prompts zzapper
2005-07-18 15:54 ` zzapper
2005-07-18 18:27 ` Wayne Davison
2005-07-18 19:29   ` zzapper

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).