Operating System - HP-UX
1830226 Members
1852 Online
109999 Solutions
New Discussion

Console output redirection

 
Mark Lawley
Contributor

Console output redirection

I need to create some documentation using screen dumps of console messages.
Is it possible to use my PC running terminal emulation software as a console, and if it is how do I go about this?
4 REPLIES 4
Marcin Wicinski
Trusted Contributor

Re: Console output redirection

Hi Mark,

If screen dumps are not necessery, you can redirect sh output to a file:

sh > file_name

Exiting: Ctrl+D

Later,
Marcin Wicinski
Stefan Schulz
Honored Contributor

Re: Console output redirection

You can use the programm script to log all your console messages. Just use script and everything you type and every echo on your screen is written to the given filename.

If you exit this shell the script stops and you can use the file as a log.

As a sideeffect script prints the time started and stopped in the logfile..

Hope this helps

Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Marcin Wicinski
Trusted Contributor

Re: Console output redirection

Stefan's suggestion is better - everything will be redirected to the file (enclosing issued comands). Remember that script redirects control characersas well.

take care,

marcin
Marcin Wicinski
Steve Post
Trusted Contributor

Re: Console output redirection

After I exit from "script > fileout." I edit fileout with vi, and see tons of control-M's.

I substitute control-M with a nothing.
The control-v tells vi to treat the next key literally.
:%s/control-vcontrol-m//g

I next look for control-H (the backspace key), I retype this text by hand.

I delete any strange lines too. This could be from running more commands or vi while still running the script command. You'll know what I'm talking about, a 5000 character line of gibberish.