LinuxCommandLibrary

scriptreplay

Replay terminal sessions recorded by 'script'

TLDR

Replay a typescript at the speed it was recorded

$ scriptreplay [path/to/timing_file] [path/to/typescript]
copy

Replay a typescript at double the original speed
$ scriptreplay [path/to/timingfile] [path/to/typescript] 2
copy

Replay a typescript at half the original speed
$ scriptreplay [path/to/timingfile] [path/to/typescript] 0.5
copy

SYNOPSIS

scriptreplay [options] timingfile [ typescript ]

PARAMETERS

-t, --timing-file timingfile
    Specifies the timing file to use for replay.

typescript
    Specifies the typescript file to replay. If omitted, `typescript` is used.

timingfile
    Specifies the timing file to replay. If omitted, `timing` is used.

-m, --maxdelay seconds
    Specify maximum time interval between writing to terminal.

-d, --divisor number
    Speeds up the replay by specified divisor. Divisor should be greater than zero.

-V, --version
    Display version information and exit.

-h, --help
    Display help text and exit.

DESCRIPTION

The scriptreplay command is used to replay terminal sessions recorded using the script command. It reads timing data from a specified timing file and character data from a corresponding typescript file to accurately reproduce the session's original timing and output. This allows you to review terminal interactions step-by-step, making it useful for demonstrations, training, debugging, and auditing purposes.

scriptreplay takes arguments to specify the timing and typescript files, or it attempts to use default file names. It paces the replay to match the original session's speed, providing a more realistic viewing experience than simply displaying the contents of the typescript file at once. The speed can be adjusted using the `-d` option. This ensures that the replayed output matches what a user saw during the initial session, even for dynamic or interactive applications. The tool is frequently employed in environments where precise record-keeping and accurate reproduction of terminal activity are crucial.

CAVEATS

If the timing file or typescript file is corrupted or missing, scriptreplay may fail to replay the session correctly. It's dependent on the accuracy of the timing information recorded by script. Also, replaying terminal sessions that involve interactive input will not be truly interactive, it just shows recorded interaction.

USAGE EXAMPLES

scriptreplay timing.log typescript.log - Replays the session using timing.log for timing and typescript.log for output.
scriptreplay -d 2 timing.log typescript.log - Replays the session at twice the original speed.
scriptreplay timing.log - Replays the session using 'timing.log' for timing and 'typescript' for output.

HISTORY

The scriptreplay command is designed to accompany the script command. script creates a typescript and timing file pair. Then, scriptreplay lets you replay the contents of the typescript file at the speed it was originally recorded.

SEE ALSO

script(1)

Copied to clipboard