lunch.za.net
script
Script is a tool for recording a terminal session in Linux (originally BSD) so
that it can be replayed (and sometimes just to capture the output). In Debian
and Ubuntu systems, it's part of the util-linux package in the misc-utils
sub-directory. While most of the other commands in util-linux have
bells and whistles, script has suffered from a certain lack of polish.
This page is for an improved version of script that is a lot more
intuitive to use ... and it does more too. It is not the whole application -
just the .c file and the man page.
Changes
- script > typescript -- record session with timing
- script < typescript -- replay session with timing
- Full backward compatibility with old command lines and file formats (such as they are)
- Screen saver launch and idle time support
- Expanded man page with examples
- Key logging support
- Single file format storing timing information as an escape code.
- Single process with select() rather than dual pipes - this makes the screensaver possible.
Since the file format stores the timing information as an escape code, it is
part of the data stream. This means that recorded terminal sessions can be
treated like any other file - streaming, appending, head, tail, sampled, etc,
without an inflexible association between the data file and a separate timing
file.
The virtual escape code for delay is ESC [ 42 ; seconds ; milliseconds ], inspired by the
Linux console escape codes of the same form.
Source code
You'll need the util-linux code as well as this - this is just the bits I have hacked:
It's 2008/02/16 23:30, and all's well.