xref: /original-bsd/usr.bin/script/script.1 (revision 95a66346)
1.\" Copyright (c) 1980, 1990 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)script.1	6.4 (Berkeley) 03/14/91
7.\"
8.Vx
9.Vx
10.Dd
11.Dt SCRIPT 1
12.Os BSD 4
13.Sh NAME
14.Nm script
15.Nd make typescript of terminal session
16.Sh SYNOPSIS
17.Nm script
18.Op Fl a
19.Op Ar file
20.Sh DESCRIPTION
21.Nm Script
22makes a typescript of everything printed on your terminal.
23It is useful for students who need a hardcopy record of an interactive
24session as proof of an assignment, as the typescript file
25can be printed out later with
26.Xr lpr 1 .
27.Pp
28If the argument
29.Ar file
30is given,
31.Nm
32saves all dialogue in
33.Ar file .
34If no file name is given, the typescript is saved in the file
35.Pa typescript  .
36.Pp
37Option:
38.Tw Ds
39.Tp Fl a
40Append the output to
41.Ar file
42or
43.Pa typescript ,
44retaining the prior contents.
45.Tp
46.Pp
47The script ends when the forked shell exits (a
48.Em control-D
49to exit
50the Bourne shell
51.Pf \&( Xr sh 1 ) ,
52and
53.Em exit ,
54.Em logout
55or
56.Em control-d
57(if
58.Em ignoreeof
59is not set) for the
60C-shell,
61.Xr csh 1 ) .
62.Pp
63Certain interactive commands, such as
64.Xr vi 1 ,
65create garbage in the typescript file.
66.Nm Script
67works best with commands that do not manipulate the
68screen, the results are meant to emulate a hardcopy
69terminal.
70.Sh ENVIRONMENT
71The following environment variable is utilized by
72.Nm script :
73.Tw SHELL
74.Tp Ev SHELL
75If the variable
76.Ev SHELL
77exists, the shell forked by
78.Nm script
79will be that shell. If
80.Ev SHELL
81is not set, the Bourne shell
82is assumed. (Most shells set this variable automatically).
83.Tp
84.Sh SEE ALSO
85.Xr csh 1
86(for the
87.Em history
88mechanism).
89.Sh HISTORY
90.Nm Script
91appeared in 3 BSD.
92.Sh BUGS
93.Nm Script
94places
95.Sy everything
96in the log file, including linefeeds and backspaces.
97This is not what the naive user expects.
98