Making a log of command line activity

To create a transcript of everything that you type and what the computer outputs at a unix command line you can use the unix program script. (See Unix Basics if you normally work on a Windows machine which does not support this type of command line capture. It includes instructions for logging into unix.ic.ucsc.edu.)

If already running on unix (Mac or Linux) or after logging into unix.ic.ucsc.edu, you type:

script someFileName.txt

which will start the script and immediately give you back a command prompt. From then on, everything that appears in the command window will be saved to the file someFileName.txt. This will continue until you type exit at the command line to the OS. Here is an example. What the user types is in bold.

os-propmpt% script logOfActivity.txt
Script started, output file is logOfActivity.txt
os-propmpt% java Adventure
Welcome to Charlie's Adventure.
You can move around by typing north, south, east, or west.
You can see what is in the room your are in by typing look.
You can pick things up by typing 'pickup thing' where thing is what you see in the room.
You can drop things you are carrying by typing 'drop thing' where thing names someting you have.
You can see your status by typing status and quit by typing quit.

north
You just entered Entry Way
south
You just entered Room 1
look
You see:
gold:100
lead:1
poison:-10

pickup gold
You now have gold:100
quit
Good bye.
os-propmpt% exit

Script done, output file is logOfActivity.txt
os-propmpt%


At the end of the above, the contents of logOfActivity.txt is:

Script started on Fri Apr 27 18:14:12 2012
os-prompt% java Adventure
Welcome to Charlie's Adventure.
You can move around by typing north, south, east, or west.
You can see what is in the room your are in by typing look.
You can pick things up by typing 'pickup thing' where thing is what you see in the room.
You can drop things you are carrying by typing 'drop thing' where thing names someting you have.
You can see your status by typing status and quit by typing quit.

north
You just entered Entry Way
south
You just entered Room 1
look
You see:
gold:100
lead:1
poison:-10

pickup gold
You now have gold:100
quit
Good bye.
os-prompt% exit

Script done on Fri Apr 27 18:14:40 2012


The file logOfActivity.txt is what you can include in the readMe.txt file to show how your program behaves.