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