xref: /netbsd-src/usr.bin/script/script.1 (revision d9158b13b5dfe46201430699a3f7a235ecf28df3)
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.\"	from: @(#)script.1	6.5 (Berkeley) 7/27/91
33.\"	$Id: script.1,v 1.2 1993/08/01 07:28:51 mycroft Exp $
34.\"
35.Dd July 27, 1991
36.Dt SCRIPT 1
37.Os BSD 4
38.Sh NAME
39.Nm script
40.Nd make typescript of terminal session
41.Sh SYNOPSIS
42.Nm script
43.Op Fl a
44.Op Ar file
45.Sh DESCRIPTION
46.Nm Script
47makes a typescript of everything printed on your terminal.
48It is useful for students who need a hardcopy record of an interactive
49session as proof of an assignment, as the typescript file
50can be printed out later with
51.Xr lpr 1 .
52.Pp
53If the argument
54.Ar file
55is given,
56.Nm
57saves all dialogue in
58.Ar file .
59If no file name is given, the typescript is saved in the file
60.Pa typescript  .
61.Pp
62Option:
63.Bl -tag -width Ds
64.It Fl a
65Append the output to
66.Ar file
67or
68.Pa typescript ,
69retaining the prior contents.
70.El
71.Pp
72The script ends when the forked shell exits (a
73.Em control-D
74to exit
75the Bourne shell
76.Pf ( Xr sh 1 ) ,
77and
78.Em exit ,
79.Em logout
80or
81.Em control-d
82(if
83.Em ignoreeof
84is not set) for the
85C-shell,
86.Xr csh 1 ) .
87.Pp
88Certain interactive commands, such as
89.Xr vi 1 ,
90create garbage in the typescript file.
91.Nm Script
92works best with commands that do not manipulate the
93screen, the results are meant to emulate a hardcopy
94terminal.
95.Sh ENVIRONMENT
96The following environment variable is utilized by
97.Nm script :
98.Bl -tag -width SHELL
99.It Ev SHELL
100If the variable
101.Ev SHELL
102exists, the shell forked by
103.Nm script
104will be that shell. If
105.Ev SHELL
106is not set, the Bourne shell
107is assumed. (Most shells set this variable automatically).
108.El
109.Sh SEE ALSO
110.Xr csh 1
111(for the
112.Em history
113mechanism).
114.Sh HISTORY
115The
116.Nm script
117command appeared in
118.Bx 3.0 .
119.Sh BUGS
120.Nm Script
121places
122.Sy everything
123in the log file, including linefeeds and backspaces.
124This is not what the naive user expects.
125