summaryrefslogtreecommitdiff
path: root/usr.bin/script/script.1
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/script/script.1')
-rw-r--r--usr.bin/script/script.117
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1
index 3887a771e17..f10ec2d4b34 100644
--- a/usr.bin/script/script.1
+++ b/usr.bin/script/script.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: script.1,v 1.14 2012/01/15 20:06:40 schwarze Exp $
+.\" $OpenBSD: script.1,v 1.15 2018/01/21 20:18:20 jasper Exp $
.\" $NetBSD: script.1,v 1.3 1994/12/21 08:55:41 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)script.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd $Mdocdate: January 15 2012 $
+.Dd $Mdocdate: January 21 2018 $
.Dt SCRIPT 1
.Os
.Sh NAME
@@ -39,6 +39,7 @@
.Sh SYNOPSIS
.Nm script
.Op Fl a
+.Op Fl c Ar command
.Op Ar file
.Sh DESCRIPTION
.Nm
@@ -65,9 +66,14 @@ Append the output to
or
.Pa typescript ,
retaining the prior contents.
+.It Fl c Ar command
+Run
+.Ar command
+instead of an interactive shell.
+To run a command with arguments, enclose both in quotes.
.El
.Pp
-The script ends when the forked shell exits (a control-D
+The script ends when the forked program exits (a control-D
.Pq Ql ^D
to exit
the Bourne shell
@@ -102,6 +108,11 @@ Name of the shell to be forked by
If not set, the Bourne shell is assumed.
(Most shells set this variable automatically.)
.El
+.Sh EXAMPLES
+Start a virtual machine and log all console output to a file:
+.Bd -literal -offset indent
+$ script -c "vmctl start myvm -c" myvm.typescript
+.Ed
.Sh HISTORY
A predecessor called
.Nm dribble