]> git.saurik.com Git - apple/shell_cmds.git/blobdiff - script/script.1
shell_cmds-187.tar.gz
[apple/shell_cmds.git] / script / script.1
index 8c0dae925069490114c79e45074b2f6c20ff52f3..ad12c53338cb3b4080cd0725e96e9d00745cef47 100644 (file)
@@ -9,10 +9,6 @@
 .\" 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.
@@ -30,9 +26,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"    @(#)script.1    8.1 (Berkeley) 6/6/93
-.\" $FreeBSD: src/usr.bin/script/script.1,v 1.21 2004/07/03 00:24:43 ru Exp $
+.\" $FreeBSD$
 .\"
-.Dd January 22, 2004
+.Dd December 4, 2013
 .Dt SCRIPT 1
 .Os
 .Sh NAME
@@ -40,7 +36,8 @@
 .Nd make typescript of terminal session
 .Sh SYNOPSIS
 .Nm
-.Op Fl akq
+.Op Fl adkpqr
+.Op Fl F Ar pipe
 .Op Fl t Ar time
 .Op Ar file Op Ar command ...
 .Sh DESCRIPTION
@@ -76,16 +73,40 @@ Append the output to
 or
 .Pa typescript ,
 retaining the prior contents.
+.It Fl d
+When playing back a session with the
+.Fl p
+flag, do not sleep between records when playing back a timestamped session.
+.It Fl F Ar pipe
+Immediately flush output after each write.
+This will allow a user to create a named pipe using
+.Xr mkfifo 1
+and another user may watch the live session using a utility like
+.Xr cat 1 .
+.\".It Fl f
+.\"Create
+.\".Ar file.filemon
+.\"or
+.\".Pa typescript.filemon
+.\"using
+.\".Xr filemon 4 .
 .It Fl k
-Log keys sent to program as well as output.
+Log keys sent to the program as well as output.
+.It Fl p
+Play back a session recorded with the
+.Fl r
+flag in real time.
 .It Fl q
-Run in quiet mode, omit the start and stop status messages.
+Run in quiet mode, omit the start, stop and command status messages.
+.It Fl r
+Record a session with input, output, and timestamping.
 .It Fl t Ar time
-Specify time interval between flushing script output file.
+Specify the interval at which the script output file will be flushed
+to disk, in seconds.
 A value of 0
 causes
 .Nm
-to flush for every character I/O event.
+to flush after every character I/O event.
 The default interval is
 30 seconds.
 .El
@@ -114,9 +135,22 @@ The
 utility works best with commands that do not manipulate the screen.
 The results are meant to emulate a hardcopy terminal, not an addressable one.
 .Sh ENVIRONMENT
-The following environment variable is utilized by
+The following environment variables are utilized by
 .Nm :
 .Bl -tag -width SHELL
+.It Ev SCRIPT
+The
+.Ev SCRIPT
+environment variable is added to the sub-shell.
+If
+.Ev SCRIPT
+already existed in the users environment,
+its value is overwritten within the sub-shell.
+The value of
+.Ev SCRIPT
+is the name of the
+.Ar typescript
+file.
 .It Ev SHELL
 If the variable
 .Ev SHELL
@@ -127,18 +161,31 @@ If
 .Ev SHELL
 is not set, the Bourne shell
 is assumed.
-(Most shells set this variable automatically).
+.Pq Most shells set this variable automatically .
 .El
 .Sh SEE ALSO
 .Xr csh 1
-(for the
-.Em history
-mechanism).
+.\".Xr filemon 4
+.\".Po
+.\"for the
+.\".Em history
+.\"mechanism
+.\".Pc .
 .Sh HISTORY
 The
 .Nm
 command appeared in
 .Bx 3.0 .
+.Pp
+The
+.Fl d ,
+.Fl p
+and
+.Fl r
+options first appeared in
+.Nx 2.0
+and were ported to
+.Fx 9.2 .
 .Sh BUGS
 The
 .Nm
@@ -156,4 +203,15 @@ mode, echo cancelling is far from ideal.
 The slave terminal mode is checked
 for ECHO mode to check when to avoid manual echo logging.
 This does not
-work when in a raw mode where the program being run is doing manual echo.
+work when the terminal is in a raw mode where
+the program being run is doing manual echo.
+.Pp
+If
+.Nm
+reads zero bytes from the terminal, it switches to a mode when it
+only attempts to read
+once a second until there is data to read.
+This prevents
+.Nm
+from spinning on zero-byte reads, but might cause a 1-second delay in
+processing of user input.