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