.TH script "" "" Command
.PC "Capture a terminal session into a file"
\fBscript [\-l \fIlogfile\^\fB] [\fIcommand\^\fB]\fR
.PP
.HS
.SH Options:
.IC \fB\-l\fR
Name \fIlogfile\fP as the output file
.HE
.II "terminal^capture session"
.II "log^terminal session"
The \*(CO command
.B script
executes
.I command
while copying all terminal output to
.IR logfile .
.I logfile
defaults to file \fBLog.\fIpid\fR in your current directory, where
.I pid
is the number of the recording process.
.I command
must specify a full path name.
If the terminal echoes keyboard input,
.B script
records these keystrokes in
.IR logfile .
.PP
If no
.I command
is specified,
.B script
executes the command specified by environmental variable
.B SHELL
by default.
If
.B SHELL
is not defined,
.B script
assumes
.BR /bin/sh .
.PP
To exit from
.BR script ,
just type
.B exit
from a command prompt.
.SH "See Also"
.Xr "commands" commands
.SH Notes
.B script
is intended to capture what you type for purposes of debugging.
What it captures cannot be replayed into the shell.
