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