Tuesday, January 20, 2004

script / record / replay

record a session to a file.. use script.

creates a typescript file that can be played back. App available to play them back, compiled from RPM util-linux

SCRIPT(1)                 BSD General Commands Manual                SCRIPT(1)

NAME
     script - make typescript of terminal session

SYNOPSIS
     script [-a] [-f] [-q] [-t] [file]

DESCRIPTION
     Script makes a typescript of everything printed on your terminal.  It is
     useful for students who need a hardcopy record of an interactive session
     as proof of an assignment, as the typescript file can be printed out
     later with lpr(1).

     If the argument file is given, script saves all dialogue in file.  If no
     file name is given, the typescript is saved in the file typescript.

     Options:

     -a    Append the output to file or typescript, retaining the prior con-
             tents.

     -f     Flush output after each write. This is nice for telecooperation:
             One person does `mkfifo foo; script -f foo' and another can
             supervise real-time what is being done using `cat foo'.

     -q     Be quiet.

     -t     Output timeing data to standard error. This data contains two
             fields, separated by a space. The first field indicates how much
             time elapsed since the previous output. The second field indi-
             cates how many characters were output this time. This information
             can be used to replay typescripts with realistic typing and out-
             put delays.

     The script ends when the forked shell exits (a control-D to exit the
     Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not
     set) for the C-shell, csh(1)).

     Certain interactive commands, such as vi(1), create garbage in the type-
     script file.  Script works best with commands that do not manipulate the
     screen, the results are meant to emulate a hardcopy terminal.

Playback of script files

REPLAY(1)             User Contributed Perl Documentation            REPLAY(1)

NAME
       replay - play back typescripts, using timing information

SYNOPSIS
       replay timingfile [typescript [divisor]]

DESCRIPTION
       This program replays a typescript, using timing information to ensure
       that output happens at the same speed as it originally appeared when
       the script was recorded. It is only guaranteed to work properly if run
       on the same terminal the script was recorded on.

       The timings information is what script outputs to standard error if it
       is run with the -t parameter.

       By default, the typescript to display is assumed to be named "type-
       script", but other filenames may be specified, as the second parameter.

       If the third parameter exits, it is used as a time divisor. For exam-
       ple, specifying a divisor of 2 makes the script be replayed twice as
       fast.

EXAMPLE
        % script -t 2> timingfile
        Script started, file is typescript
        % ls
        
        % exit
        Script done, file is typescript
        % replay timingfile

SEE ALSO
       script(1)