Thursday, May 16, 2013

Make and play transcripts of terminal sessions

This is great for teaching programming or Unix usage, for producing "live" documentation for some common tasks. You may also want to make a transcript of a terminal session if you are planning to develop a script to automate the task later on.

It is advisable to save timing information along with the transcript so that you can reply it.

Record:
$ script -t transcript.tm transcript.txt

Play (you better use the same type of terminal you recorded from):
$ scriptreplay -t transcript.tm transcript.txt

scriptreplay can't do without a timing file. If you have forgot the -t option, an acceptable way to display the script could be by disabling printing of raw control characters in less using the usual caret notation (e.g. ^C):

$ less -r transcript.txt

but this won't work well with programs who clear the screen like vi(1).

No comments: