xref: /openbsd-src/usr.bin/script/script.1 (revision 1fc27e414118cd8922c6b93fbaeb7a5246bfd593)
1.\"	$OpenBSD: script.1,v 1.4 1999/06/05 01:21:39 aaron Exp $
2.\"	$NetBSD: script.1,v 1.3 1994/12/21 08:55:41 jtc Exp $
3.\"
4.\" Copyright (c) 1980, 1990, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by the University of
18.\"	California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"	@(#)script.1	8.1 (Berkeley) 6/6/93
36.\"
37.Dd June 6, 1993
38.Dt SCRIPT 1
39.Os
40.Sh NAME
41.Nm script
42.Nd make typescript of terminal session
43.Sh SYNOPSIS
44.Nm script
45.Op Fl a
46.Op Ar file
47.Sh DESCRIPTION
48.Nm
49makes a typescript of everything printed on your terminal.
50It is useful for students who need a hardcopy record of an interactive
51session as proof of an assignment, as the typescript file
52can be printed out later with
53.Xr lpr 1 .
54.Pp
55If the argument
56.Ar file
57is given,
58.Nm
59saves all dialogue in
60.Ar file .
61If no file name is given, the typescript is saved in the file
62.Pa typescript  .
63.Pp
64Option:
65.Bl -tag -width Ds
66.It Fl a
67Append the output to
68.Ar file
69or
70.Pa typescript ,
71retaining the prior contents.
72.El
73.Pp
74The script ends when the forked shell exits (a
75.Em control-D
76to exit
77the Bourne shell
78.Pf ( Xr sh 1 ) ,
79and
80.Em exit ,
81.Em logout
82or
83.Em control-d
84(if
85.Em ignoreeof
86is not set) for the
87C-shell,
88.Xr csh 1 ) .
89.Pp
90Certain interactive commands, such as
91.Xr vi 1 ,
92create garbage in the typescript file.
93.Nm
94works best with commands that do not manipulate the
95screen, the results are meant to emulate a hardcopy
96terminal.
97.Sh ENVIRONMENT
98The following environment variable is utilized by
99.Nm script :
100.Bl -tag -width SHELL
101.It Ev SHELL
102If the variable
103.Ev SHELL
104exists, the shell forked by
105.Nm
106will be that shell. If
107.Ev SHELL
108is not set, the Bourne shell
109is assumed. (Most shells set this variable automatically.)
110.El
111.Sh SEE ALSO
112.Xr csh 1
113(for the
114.Em history
115mechanism)
116.Sh HISTORY
117The
118.Nm
119command appeared in
120.Bx 3.0 .
121.Sh BUGS
122.Nm
123places
124.Em everything
125in the log file, including linefeeds and backspaces.
126This is not what the naive user expects.
127