script

NAME

script - make typescript of terminal session

SYNOPSIS

script [-a] [-F secs] [file]

DESCRIPTION

The script(1) utility makes a typescript of everything printed on your terminal. It is useful for users, such as students, who need a hardcopy record as proof of an interactive session; the typescript file can be printed out later with lp(1).

If the argument file is given, script(1) saves all dialog in file. If no file name is given, the typescript is saved in the file typescript.

Options are as follows:

-a
Append the output to file or typescript, retaining the prior contents.
-F secs
Flush stdio buffer to the typescript file every secs seconds. If secs is 0, the stdio buffer is flushed with every call to write(3); the default is to flush every 30 seconds.

The script ends when the forked shell exits. (To exit sh(1) on Interix systems, use CTRL+D; to exit csh(1), use exit(1), logout(1), or, if ignoreeof is not set, use CTRL+D.)

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

ENVIRONMENT

The following environment variable is utilized by script(1):

SHELL
If the variable SHELL exists, the shell forked by script(1) will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically).

NOTES

The script(1) utility places everything in the log file, including linefeeds and backspaces. This might not be what an inexperienced user expects.

SEE ALSO

csh(1) (for the history mechanism)