Annotation of src/usr.bin/script/script.1, Revision 1.15
1.15 ! jasper 1: .\" $OpenBSD: script.1,v 1.14 2012/01/15 20:06:40 schwarze Exp $
1.1 deraadt 2: .\" $NetBSD: script.1,v 1.3 1994/12/21 08:55:41 jtc Exp $
3: .\"
4: .\" Copyright (c) 1980, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.10 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)script.1 8.1 (Berkeley) 6/6/93
32: .\"
1.15 ! jasper 33: .Dd $Mdocdate: January 15 2012 $
1.1 deraadt 34: .Dt SCRIPT 1
1.4 aaron 35: .Os
1.1 deraadt 36: .Sh NAME
37: .Nm script
38: .Nd make typescript of terminal session
39: .Sh SYNOPSIS
40: .Nm script
41: .Op Fl a
1.15 ! jasper 42: .Op Fl c Ar command
1.1 deraadt 43: .Op Ar file
44: .Sh DESCRIPTION
1.4 aaron 45: .Nm
1.1 deraadt 46: makes a typescript of everything printed on your terminal.
47: It is useful for students who need a hardcopy record of an interactive
1.4 aaron 48: session as proof of an assignment, as the typescript file
1.1 deraadt 49: can be printed out later with
50: .Xr lpr 1 .
51: .Pp
52: If the argument
53: .Ar file
54: is given,
55: .Nm
56: saves all dialogue in
57: .Ar file .
58: If no file name is given, the typescript is saved in the file
1.6 aaron 59: .Pa typescript .
1.1 deraadt 60: .Pp
1.5 aaron 61: The options are as follows:
1.1 deraadt 62: .Bl -tag -width Ds
63: .It Fl a
64: Append the output to
65: .Ar file
66: or
67: .Pa typescript ,
68: retaining the prior contents.
1.15 ! jasper 69: .It Fl c Ar command
! 70: Run
! 71: .Ar command
! 72: instead of an interactive shell.
! 73: To run a command with arguments, enclose both in quotes.
1.1 deraadt 74: .El
75: .Pp
1.15 ! jasper 76: The script ends when the forked program exits (a control-D
1.5 aaron 77: .Pq Ql ^D
1.1 deraadt 78: to exit
79: the Bourne shell
80: .Pf ( Xr sh 1 ) ,
81: and
1.5 aaron 82: .Ic exit ,
83: .Ic logout ,
84: or control-D
1.1 deraadt 85: (if
1.5 aaron 86: .Va ignoreeof
1.1 deraadt 87: is not set) for the
88: C-shell,
89: .Xr csh 1 ) .
1.7 ericj 90: .Nm
1.8 aaron 91: will exit with the status of 0 unless any of its child
1.12 jmc 92: processes fail.
93: In which case,
1.8 aaron 94: .Nm
1.7 ericj 95: will return 1.
1.1 deraadt 96: .Pp
97: Certain interactive commands, such as
98: .Xr vi 1 ,
99: create garbage in the typescript file.
1.4 aaron 100: .Nm
1.1 deraadt 101: works best with commands that do not manipulate the
1.5 aaron 102: screen; the results are meant to emulate a hardcopy terminal.
1.1 deraadt 103: .Sh ENVIRONMENT
104: .Bl -tag -width SHELL
105: .It Ev SHELL
1.5 aaron 106: Name of the shell to be forked by
107: .Nm script .
108: If not set, the Bourne shell is assumed.
109: (Most shells set this variable automatically.)
1.1 deraadt 110: .El
1.15 ! jasper 111: .Sh EXAMPLES
! 112: Start a virtual machine and log all console output to a file:
! 113: .Bd -literal -offset indent
! 114: $ script -c "vmctl start myvm -c" myvm.typescript
! 115: .Ed
1.1 deraadt 116: .Sh HISTORY
1.14 schwarze 117: A predecessor called
118: .Nm dribble
119: appeared in
120: .Bx 2 .
1.1 deraadt 121: The
1.4 aaron 122: .Nm
1.14 schwarze 123: command first appeared in
124: .Bx 3 .
125: .Sh AUTHORS
126: .An Mark Horton .
1.1 deraadt 127: .Sh BUGS
1.4 aaron 128: .Nm
1.1 deraadt 129: places
1.3 aaron 130: .Em everything
1.1 deraadt 131: in the log file, including linefeeds and backspaces.
132: This is not what the naive user expects.