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