386BSD 0.1 development
[unix-history] / usr / src / usr.bin / script / script.1
index 14a3caf..ddc3522 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1990 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)script.1    4.1 (Berkeley) %G%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.TH SCRIPT 1
-.UC 4
-.SH NAME
-script \- make typescript of terminal session
-.SH SYNOPSIS
-.B script
-[
-.B \-a
-] [
-.B \-q
-] [
-.B \-S
-shell
-] [ file ]
-.SH DESCRIPTION
-.I Script
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"    @(#)script.1    6.5 (Berkeley) 7/27/91
+.\"
+.Dd July 27, 1991
+.Dt SCRIPT 1
+.Os BSD 4
+.Sh NAME
+.Nm script
+.Nd make typescript of terminal session
+.Sh SYNOPSIS
+.Nm script
+.Op Fl a
+.Op Ar file
+.Sh DESCRIPTION
+.Nm Script
 makes a typescript of everything printed on your terminal.
 makes a typescript of everything printed on your terminal.
-The typescript is saved in a file, and can be sent to the
-line printer later with
-.I lpr.
-If a file name is given, the typescript
-is saved there.  If not, the typescript is saved in the file
-.I typescript.
-.PP
-To exit script, type control D.  This sends an end of file to
-all processes you have started up, and causes script to exit.
-For this reason, control D behaves as though you had typed an
-infinite number of control D's.
-.PP
-This program is useful when using a crt and a hard-copy
-record of the dialog is desired, as for a student handing
-in a program that was developed on a crt when hard-copy
-terminals are in short supply.
-.PP
-.B \-S
-lets you specify the shell to use.
-The default depends on the system:
-If the variable SHELL is set in the environment, it is used if possible.
-.PP
-The
-.B \-q
-flag asks for ``quiet mode'', where the ``script started''
-and ``script done'' messages are turned off.
+It is useful for students who need a hardcopy record of an interactive
+session as proof of an assignment, as the typescript file 
+can be printed out later with
+.Xr lpr 1 .
+.Pp
+If the argument
+.Ar file
+is given,
+.Nm
+saves all dialogue in
+.Ar file .
+If no file name is given, the typescript is saved in the file
+.Pa typescript  .
+.Pp
+Option:
+.Bl -tag -width Ds
+.It Fl a
+Append the output to
+.Ar file
+or
+.Pa typescript ,
+retaining the prior contents.
+.El
+.Pp
+The script ends when the forked shell exits (a
+.Em control-D
+to exit
+the Bourne shell
+.Pf ( Xr sh 1 ) ,
+and
+.Em exit , 
+.Em logout
+or
+.Em control-d
+(if
+.Em ignoreeof
+is not set) for the
+C-shell,
+.Xr csh 1 ) .
+.Pp
+Certain interactive commands, such as
+.Xr vi 1 ,
+create garbage in the typescript file.
+.Nm Script
+works best with commands that do not manipulate the
+screen, the results are meant to emulate a hardcopy
+terminal.
+.Sh ENVIRONMENT
+The following environment variable is utilized by
+.Nm script :
+.Bl -tag -width SHELL
+.It Ev SHELL
+If the variable
+.Ev SHELL
+exists, the shell forked by
+.Nm script
+will be that shell. If
+.Ev SHELL
+is not set, the Bourne shell
+is assumed. (Most shells set this variable automatically).
+.El
+.Sh SEE ALSO
+.Xr csh 1
+(for the
+.Em history
+mechanism).
+.Sh HISTORY
 The
 The
-.B \-a
-flag causes script to append to the typescript file
-instead of creating a new file.
-.SH AUTHOR
-Mark Horton
-.SH BUGS
-Since UNIX has no way to write an end-of-file down a pipe without closing
-the pipe, there is no way to simulate a single control D without
-ending script.
-.PP
-The new shell has its standard input coming
-from a pipe rather than a tty, so stty will not work, and neither
-will ttyname.
-In particular, this means that screen editors such as
-.IR vi (1)
-and the job control facilities of
-.IR csh (1)
-are inoperative.
-.PP
-When the user interrupts a printing process,
-.I script
-attempts to flush the output backed up in the pipe for better response.
-Usually the next prompt also gets flushed.
+.Nm script
+command appeared in
+.Bx 3.0 .
+.Sh BUGS
+.Nm Script
+places
+.Sy everything
+in the log file, including linefeeds and backspaces.
+This is not what the naive user expects.