[comp.unix.questions] how to capture text output during program?

steckner@lri.uwo.ca (Michael Steckner) (05/25/91)

I was wondering if there is a simple way for me to capture the output
to the screen generated while I run a program which also requires
periodic user input. Use of redirects is easy, if you dont also
have to answer any questions the program might having during execution.

This would be equivalent to the MSdos Cntrl Print command which automatically
captures what ever comes across the screen and dumps it to the printer. In
this unix case, i would like to save it too a file instead.

Any tips would be greatly appreciated.

PS the output is greater than one screen long, otherwise I could just
grab what was on the screem. I am doing this on SGI personal iris.

gordon@osiris.cso.uiuc.edu (John Gordon) (05/25/91)

steckner@lri.uwo.ca (Michael Steckner) writes:

>I was wondering if there is a simple way for me to capture the output
>to the screen generated while I run a program which also requires
>periodic user input. Use of redirects is easy, if you dont also
>have to answer any questions the program might having during execution.

>This would be equivalent to the MSdos Cntrl Print command which automatically
>captures what ever comes across the screen and dumps it to the printer. In
>this unix case, i would like to save it too a file instead.

>Any tips would be greatly appreciated.

	Check out the "script" command.
John

zebr361@ut-emx.uucp (toney cassel) (05/25/91)

In article <9105241726.AA16913@?lri.uwo.ca> steckner@lri.uwo.ca (Michael Steckner) writes:
>I was wondering if there is a simple way for me to capture the output
>to the screen generated while I run a program which also requires
>periodic user input. Use of redirects is easy, if you dont also
>have to answer any questions the program might having during execution.

command | tee filename    will send the output to both the screen and filename.

Toney Cassel   St. Edward's University   Academic Computer Lab   Good Day.

jc@raven.bu.edu (James Cameron) (05/26/91)

>>>>> On 24 May 91 17:26:32 GMT, steckner@lri.uwo.ca (Michael Steckner) said:

Michael> I was wondering if there is a simple way for me to capture the output
Michael> to the screen generated while I run a program which also requires
Michael> periodic user input. Use of redirects is easy, if you dont also
Michael> have to answer any questions the program might having during execution

	Try using script(1)  It scarfs most everything, including 
	control characters.  You might want to look for something
	called 'unscript' as well, which cleans up the control
	characters as best as it can.  

jc

--
					-- James Cameron  (jc@raven.bu.edu)

Signal Processing and Interpretation Lab.  Boston, Mass  (617) 353-2879
------------------------------------------------------------------------------
"But to risk we must, for the greatest hazard in life is to risk nothing.  For
the man or woman who risks nothing, has nothing, does nothing, is nothing."
	(Quote from the eulogy for the late Christa McAuliffe.)