there is supposed to be a way in bash / ksh to record your session ?

I run scripts and find out stuff from many boxes using remote commands

I would like to record my local screen

is it ez ?

Who is Participating?
arnoldConnect With a Mentor Commented:
run script and see if that is what you want.
run commands
exit #this will terminate script and will save the typescript file.
more typescript
Alternatively, you want to specify a filename that changes with the data on which it runs
script   -a script_fle.`date +"%Y%m%d"`

The -a flag will append data to the file, if you run it multiple times per day.  

Every time you issue a command to the Korn shell, in addition to executing the command, the shell adds it to a list of previously executed commands.

To view the list of previously executed commands, issue the history command. This displays a number (up to the number set in $HISTSIZE) of previously issued commands. $HISTSIZE is set in .profile.

Before you can recall and edit the history list directly, you must issue the ksh command set -o vi to set the vi editing mode in the shell. Similarly, the following command line sets emacs editing mode in the shell:

set -o emacs
or set -o vi (if you prefer)

run the command script
When you are done capturing the terminal hit Ctrl-D
the file is typescript.

Note that you only get the commands executed in the shell?  This is not a keylogger.
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Gerwin Jansen, EE MVETopic Advisor Commented:
If you want to 'record' the output of your remote scripts and the output goes to your screen normally, you can just redirect the output to a (daily) file. You could write simple wrapper script that calls your remote script and redirects output to something like ~/log/`date +%Y%m%d`.log
TIMFOX123Author Commented:
Tell me more :)

I want to file to cover my "6" if there is an issue on the box.

Could you explain what it is you are trying to achieve?
Are you creating a script and need to build the request/response process?
Gerwin Jansen, EE MVETopic Advisor Commented:
I agee with Arnold, what do you want to achieve? If you just want a log of what you've done, whatever mandatory check you're supposed to do, just your shell history should be enough. If you want to create proof of some kind then I suggest you create a set of cron jobs that run your check scripts, including sending mail to you, your boss etc. Creating cron jobs is a good way of working anyway, jobs I create run regularly, write output including timestamps to (daily/monthly) logfiles and send messages (warning) is something is wrong.
TIMFOX123Author Commented:
I just want to log of the local screen for future reference.

the whole thing, not just the history.

Gerwin Jansen, EE MVETopic Advisor Commented:
Do you have 'screen'? screen will do what you ask, start like this:

screen -L

Open in new window

Will log to ~/screenlog.<number> whatever you do, including commands and output.
TIMFOX123Author Commented:
this is exactly what I needed.  

Screen is good but it is not multiplatform.  

script apparently runs in solaris :)
Gerwin Jansen, EE MVETopic Advisor Commented:
Yes, screen is not multiplatform, but if you run screen on a linux box and call your remote Solaris script, it will work just fine ;)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.