1.\" $NetBSD: script.1,v 1.6 2001/12/01 16:43:24 wiz 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 a 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.El 72.Pp 73The script ends when the forked shell exits (a 74.Em control-D 75to exit 76the Bourne shell 77.Pf ( Xr sh 1 ) , 78and 79.Em exit , 80.Em logout 81or 82.Em control-d 83(if 84.Em ignoreeof 85is not set) for the 86C-shell, 87.Xr csh 1 ) . 88.Pp 89Certain interactive commands, such as 90.Xr vi 1 , 91create garbage in the typescript file. 92.Nm 93works best with commands that do not manipulate the 94screen, the results are meant to emulate a hardcopy 95terminal. 96.Sh ENVIRONMENT 97The following environment variable is utilized by 98.Nm "" : 99.Bl -tag -width SHELL 100.It Ev SHELL 101If the variable 102.Ev SHELL 103exists, the shell forked by 104.Nm 105will be that shell. If 106.Ev SHELL 107is not set, the Bourne shell 108is assumed. (Most shells set this variable automatically). 109.El 110.Sh SEE ALSO 111.Xr csh 1 112(for the 113.Em history 114mechanism). 115.Sh HISTORY 116The 117.Nm 118command appeared in 119.Bx 3.0 . 120.Sh BUGS 121.Nm 122places 123.Sy everything 124in the log file, including linefeeds and backspaces. 125This is not what the naive user expects. 126