capture command line output


Forum: Other Help Topics
Topic: capture command line output
started by: petergunn

Posted by petergunn on Jan. 19 2005,20:40
If you want to capture the output from a command line session (perhaps to post as a howto! :-) you might like to use the script command.

dsl@box:~$ script
Script started, file is typescript
dsl@box:~$ date
Wed Jan 19 15:26:43 EST 2005
dsl@box:~$ Script done, file is typescript

You hit CTRL+D to stop the recording and you will find a file called 'typescript' in the local directory that contains a log of what was recorded.

If you want to be able to replay these files then you need to record timing information as well as the typescript. Use the -t option to do this...

dsl@box:~$ script -t 2> timing.log
Script started, file is typescript
dsl@box:~$ date
Wed Jan 19 15:26:43 EST 2005
dsl@box:~$ Script done, file is typescript

You will see 2 files in the local directory; typescript and timing.log. You can now playback the files in realtime using the 'replay' command...

replay timing.log typescript

Enjoy! :-)

Posted by newOldUser on Feb. 05 2005,00:40
WOW ---  This is a hidden treasure.......

I stumbled on this post while looking for something else.  I've done a little testing and this thing looks like it could be a big help to people.

We could record how to install DSL or some other process, (like cfdisk, maybe).  Then if someone wants to see how it was done... wham, they do a download and watch the show.

Thanks for the post, lets hope others see it and start using it.

Posted by green on Feb. 05 2005,02:06
Thanks!  This one is a candidate for the documentation project.

HINT, HINT.

Posted by tronik on Feb. 05 2005,02:57
it will be added.
Posted by green on Feb. 05 2005,06:47
Why, thank you Tronik.
Posted by jdebay on Mar. 24 2005,20:51
I thankyou for sharing.
there are man pages for script and replay.
I found script also referenced in "Linux in a Nutshell" too.

:O  :O  :O  :O

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.