1 .\" Copyright (c) 1980, 1990 Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)script.1 6.5 (Berkeley) 7/27/91
34 .TH SCRIPT "1" "September 2011" "util-linux" "User Commands"
36 script \- make typescript of terminal session
42 makes a typescript of everything printed on your terminal. It is useful for
43 students who need a hardcopy record of an interactive session as proof of an
44 assignment, as the typescript file can be printed out later with
53 If no file name is given, the typescript is saved in the file
57 \fB\-a\fR, \fB\-\-append\fR
62 retaining the prior contents.
64 \fB\-c\fR, \fB\-\-command\fR \fIcommand\fR
67 rather than an interactive shell. This makes it easy for a script to capture
68 the output of a program that behaves differently when its stdout is not a
71 \fB\-e\fR, \fB\-\-return\fR
72 Return the exit code of the child process. Uses the same format as bash
73 termination on signal termination exit code is 128+n.
75 \fB\-f\fR, \fB\-\-flush\fR
76 Flush output after each write. This is nice for telecooperation: one person
77 does `mkfifo foo; script -f foo', and another can supervise real-time what is
78 being done using `cat foo'.
81 Allow the default output destination, i.e. the typescript file, to be a hard
82 or symbolic link. The command will follow a symbolic link.
84 \fB\-q\fR, \fB\-\-quiet\fR
87 \fB\-t\fR, \fB\-\-timing\fR[=\fIfile\fR]
88 Output timing data to standard error, or to
90 when given. This data contains two fields, separated by a space. The first
91 field indicates how much time elapsed since the previous output. The second
92 field indicates how many characters were output this time. This information
93 can be used to replay typescripts with realistic typing and output delays.
95 \fB\-V\fR, \fB\-\-version\fR
96 Display version information and exit.
98 \fB\-h\fR, \fB\-\-help\fR
99 Display help text and exit.
101 The script ends when the forked shell exits (a
117 Certain interactive commands, such as
119 create garbage in the typescript file.
121 works best with commands that do not manipulate the screen, the results are
122 meant to emulate a hardcopy terminal.
124 The following environment variable is utilized by
130 exists, the shell forked by
132 will be that shell. If
134 is not set, the Bourne shell is assumed. (Most shells set this variable
141 .BR scriptreplay (1).
145 command appeared in 3.0BSD.
150 in the log file, including linefeeds and backspaces. This is not what the
153 The script command is part of the util-linux package and is available from
154 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/