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

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.