]> git.ipfire.org Git - thirdparty/util-linux.git/blob - term-utils/script.1
docs: standardize the phrases for --help and --version in all man pages
[thirdparty/util-linux.git] / term-utils / script.1
1 .\" Copyright (c) 1980, 1990 Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
19 .\"
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
30 .\" SUCH DAMAGE.
31 .\"
32 .\" @(#)script.1 6.5 (Berkeley) 7/27/91
33 .\"
34 .TH SCRIPT "1" "September 2011" "util-linux" "User Commands"
35 .SH NAME
36 script \- make typescript of terminal session
37 .SH SYNOPSIS
38 .B script
39 [options] [file]
40 .SH DESCRIPTION
41 .B script
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
45 .BR lpr (1).
46 .PP
47 If the argument
48 .I file
49 is given,
50 .B script
51 saves all dialogue in
52 .IR file .
53 If no file name is given, the typescript is saved in the file
54 .IR typescript .
55 .SH OPTIONS
56 .TP
57 \fB\-a\fR, \fB\-\-append\fR
58 Append the output to
59 .I file
60 or
61 .IR typescript ,
62 retaining the prior contents.
63 .TP
64 \fB\-c\fR, \fB\-\-command\fR \fIcommand\fR
65 Run the
66 .I command
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
69 tty.
70 .TP
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.
74 .TP
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'.
79 .TP
80 \fB\-\-force\fR
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.
83 .TP
84 \fB\-q\fR, \fB\-\-quiet\fR
85 Be quiet.
86 .TP
87 \fB\-t\fR, \fB\-\-timing\fR[=\fIfile\fR]
88 Output timing data to standard error, or to
89 .I file
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.
94 .TP
95 \fB\-V\fR, \fB\-\-version\fR
96 Display version information and exit.
97 .TP
98 \fB\-h\fR, \fB\-\-help\fR
99 Display help text and exit.
100 .SH NOTES
101 The script ends when the forked shell exits (a
102 .I control-D
103 to exit
104 the Bourne shell
105 .RB ( sh (1)),
106 and
107 .IR exit ,
108 .I logout
109 or
110 .I control-d
111 (if
112 .I ignoreeof
113 is not set) for the
114 C-shell,
115 .BR csh (1)).
116 .PP
117 Certain interactive commands, such as
118 .BR vi (1),
119 create garbage in the typescript file.
120 .B Script
121 works best with commands that do not manipulate the screen, the results are
122 meant to emulate a hardcopy terminal.
123 .SH ENVIRONMENT
124 The following environment variable is utilized by
125 .BR script :
126 .TP
127 .B SHELL
128 If the variable
129 .I SHELL
130 exists, the shell forked by
131 .B script
132 will be that shell. If
133 .I SHELL
134 is not set, the Bourne shell is assumed. (Most shells set this variable
135 automatically).
136 .SH SEE ALSO
137 .BR csh (1)
138 (for the
139 .I history
140 mechanism),
141 .BR scriptreplay (1).
142 .SH HISTORY
143 The
144 .B script
145 command appeared in 3.0BSD.
146 .SH BUGS
147 .B Script
148 places
149 .B everything
150 in the log file, including linefeeds and backspaces. This is not what the
151 naive user expects.
152 .SH AVAILABILITY
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/
155 Linux Kernel Archive
156 .UE .