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