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

NAME

4     script — make typescript of terminal session
5

SYNOPSIS

7     script [-a] [-c COMMAND] [-f] [-q] [-t] [file]
8

DESCRIPTION

10     Script makes a typescript of everything printed on your terminal.  It is
11     useful for students who need a hardcopy record of an interactive session
12     as proof of an assignment, as the typescript file can be printed out
13     later with lpr(1).
14
15     If the argument file is given, script saves all dialogue in file.  If no
16     file name is given, the typescript is saved in the file typescript.
17
18     Options:
19
20     -a      Append the output to file or typescript, retaining the prior con‐
21             tents.
22
23     -c COMMAND
24             Run the COMMAND rather than an interactive shell.  This makes it
25             easy for a script to capture the output of a program that behaves
26             differently when its stdout is not a tty.
27
28     -f      Flush output after each write. This is nice for telecooperation:
29             One person does `mkfifo foo; script -f foo' and another can
30             supervise real-time what is being done using `cat foo'.
31
32     -q      Be quiet.
33
34     -t      Output timing data to standard error. This data contains two
35             fields, separated by a space. The first field indicates how much
36             time elapsed since the previous output. The second field indi‐
37             cates how many characters were output this time. This information
38             can be used to replay typescripts with realistic typing and out‐
39             put delays.
40
41     The script ends when the forked shell exits (a control-D to exit the
42     Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not
43     set) for the C-shell, csh(1)).
44
45     Certain interactive commands, such as vi(1), create garbage in the type‐
46     script file.  Script works best with commands that do not manipulate the
47     screen, the results are meant to emulate a hardcopy terminal.
48

ENVIRONMENT

50     The following environment variable is utilized by script:
51
52     SHELL  If the variable SHELL exists, the shell forked by script will be
53            that shell. If SHELL is not set, the Bourne shell is assumed.
54            (Most shells set this variable automatically).
55

SEE ALSO

57     csh(1) (for the history mechanism), scriptreplay(1).
58

HISTORY

60     The script command appeared in 3.0BSD.
61

BUGS

63     Script places everything in the log file, including linefeeds and
64     backspaces.  This is not what the naive user expects.
65
66Linux                            July 30, 2000                           Linux
Impressum