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