Commit graph

46 commits

Author SHA1 Message Date
Kyle Evans 8ceac8e13d script: handle terminal resize on SIGWINCH
Add a -w flag to forward terminal resize events on to the child, which
can be useful in some circumstances to avoid terminal corruption.

Reviewed by:	des
Co-authored-by:	Xavier Beaudouin <xavier.beaudouin@klarasystems.com>
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44167
2024-04-26 11:39:00 -05:00
Warner Losh bdcbfde31e usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:30 -07:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Dag-Erling Smørgrav 8e096e24d4 script: Correct -F in man page and usage string.
Sponsored by:	Klara, Inc.
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37138
2022-10-27 14:46:09 +00:00
Simon J. Gerraty 31fde97357 script: use %n at the end of default tstamp_fmt
Since we are only outputting time-stamps when they differ
ending it with a newline, interferes with the output less.
2022-03-10 09:42:55 -08:00
Simon J. Gerraty 6c4afed566 script add -T fmt to print time-stamps
script -r is useful for recording time-stamps of when output
happened.  With -T, rather than playback the script in real-time
we simply print the time-stamps to show when the output happened.

This is very useful for example, for analyzing boot time activity.

If the fmt provided contains no % characters the default
%n@ %s [%Y-%m-%d %T]
is used, which lends itself to analysis by tools as well as humans.

Sponsored by:	Juniper Networks, Inc.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D34511
2022-03-09 13:33:03 -08:00
Mateusz Piotrowski d41149a8e9 Add some examples to script.1
While here:

- Split synopsis into two parts. The first explains how to record
  sessions, while the second one explains how to replay (some of)
  the recorded sessions.
- Fix the -width argument of the environment variables list.

MFC after:	1 week
2021-01-05 16:32:27 +01:00
Mateusz Piotrowski 225afb6cad Improve readability of the options list
MFC after:	3 days
2021-01-05 15:46:56 +01:00
Warner Losh 44a3c7a3f8 Bump date for r365052 2020-09-01 16:13:09 +00:00
Warner Losh f9177b6c91 Have script accept and ignore -e for Linux compat
In the util-linux version of script, it will always exit with succes.
Except when run with -e, in which case it will have the exit value of
the child. BSD Script already uses the child's exit value for its exit
value. Some config and other helper scripts depend on being able to
specify -e. Accept it for compatibility since we'll already to the
right thing, but otherwise we ignore it.
2020-09-01 16:11:23 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Sergey Kandaurov d7deff23cd Fix SEE ALSO.
The history mechanism applies to csh.

Sponsored by:	Nginx, Inc.
2015-08-26 11:54:40 +00:00
Joel Dahl 914f6e6290 mdoc: sort SEE ALSO. 2014-12-26 21:56:23 +00:00
Tom Rhodes 8d105abc4f Add -F to flush output after each write. With this, I can
set up a pipe and allow a jr user to watch what I'm doing
by running 'script -F pipefile' on it.

While here, spell out the month in the .Dd tag like other
manual pages.
2013-12-05 01:44:24 +00:00
David E. O'Brien c89bc70064 MFC'ing to 9.2. 2013-07-30 19:21:36 +00:00
Sergey Kandaurov 99f23359a5 Fix version in the .Fx macro.
Reported by:	<deeptech71@gmail.com>
2013-03-16 22:37:56 +00:00
David E. O'Brien 6cff4e07c1 Add "-f" to also output filemon(4) information. 2012-10-26 15:56:28 +00:00
Joel Dahl aee53c332e Remove contractions. 2012-10-07 20:01:41 +00:00
Brian Somers fabb5579bb Mention when -d, -p and -r first hit FreeBSD.
Bump the document date to when the change was made (rather than when the PR
was submitted).

Suggested by:	pluknet
2012-07-30 08:06:00 +00:00
Brian Somers df53360c76 Add d, p and r switches for recording script sessions with timing data
and playing sessions back with or without time delays.

PR:		114465
Submitted by:	ighighi at gmail dot com
MFC after:	3 weeks
2012-07-30 07:13:06 +00:00
Glen Barber ef87c4dcd5 Fix a few grammar and mdoc nits in script.1
PR:		161088
Submitted by:	Ben Kaduk ( kaduk % mit ! edu )
MFC after:	1 week
Need-MFC:	225809
2011-09-29 02:29:32 +00:00
Mikolaj Golub 29da75477b When script(1) reads EOF from input it starts spinning on zero-byte
reads eating 100% CPU. Fix this by skipping select on STDIN after
reading EOF -- permanently if STDIN is not terminal and for one second
if it is.

Also after reading EOF from STDIN we have to pass it to the program
being scripted. The previous approach was to write zero bytes into the
pseudo-terminal. This does not work because zero-byte write does not
have any effect on read. Fix this by sending VEOF instead.

Submitted by:	Ronald Klop <ronald-freebsd8@klop.yi.org>
Discussed with:	kib, Chris Torek <chris.torek@gmail.com>
Approved by:	kib
MFC after:	1 week
2011-09-27 18:14:04 +00:00
Joel Dahl da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
David E. O'Brien aa2e033466 Fix the grammar after I added a second environmental variable.
Submitted by:	wxs
2010-09-19 00:36:26 +00:00
David E. O'Brien 9b91846ce4 + Add the SCRIPT environmental variable to the sub-shell. Its value is
the name of the typescript file.
+ Add the 'command' argument (if supplied on the command line) to the
typescript file.  This creates a more complete typescript when invoked
this way - more equal to invoking script without supplying the 'command'
argument.
2010-09-16 22:31:03 +00:00
Ruslan Ermilov 557b7fa148 Deal with double whitespace. 2004-07-03 00:24:45 +00:00
Ruslan Ermilov 6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
Ruslan Ermilov c548db0353 Bumped document date.
Fixed markup nit.
2004-05-19 09:53:03 +00:00
Sheldon Hearn 4294ff16a7 Fix SYNOPSIS of manual page, clustering no-arg options correctly.
Sync usage with manpage.
2004-01-22 21:26:41 +00:00
Philippe Charnier fed771de60 Introduce arguments the standard way. In .Ar command ..., ... is not an
argument, command is.
2003-09-07 15:43:50 +00:00
Philippe Charnier e8937ba009 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
Dima Dorfman f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Ruslan Ermilov 625003720a mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 14:16:33 +00:00
Ruslan Ermilov 8fe908ef0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
Brian Feldman 2cb6b4ef51 Make a run-on sentence into two proper sentences, and clarify the meaning
a bit.
2000-03-06 23:06:11 +00:00
Sheldon Hearn 4e86fcacf6 Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
Sheldon Hearn 87faa07bec Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 12:20:22 +00:00
Bill Fumerola 128a149b6a Fix grammar error. (missing verb) 1999-12-13 23:37:56 +00:00
Guido van Rooij 725585340b Adjust man page: if command is specified, file name is mandatory 1999-11-24 15:47:45 +00:00
Peter Wemm c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Joseph Koshy 4cbaceabf1 Mention default time between output flushes in manual page.
PR:		docs/8009
Submitted by:	Stefan Eggers <seggers@semyam.dinoco.de>
1998-09-29 01:49:49 +00:00
Steve Price 32c2131395 Fix a bunch of spelling errors.
PR:		6856
Submitted by:	Josh Gilliam <josh@quick.net>
1998-06-04 21:06:07 +00:00
Peter Wemm e8eb82a81c Rewrite script as a select loop rather than as a twin reader/write process.
This allows simple logging of keys sent to a session (turned on with -k).
Also allow specifying the script file flush interval.
1998-03-08 14:19:18 +00:00
Peter Wemm 51afb8df2c script(1) has annoyed me with it's inflexable command argument parsing
since I first saw it.  I finally needed to pass arguments through to
the spawned command badly enough (and urgently) that I threw this together.
1997-12-29 13:31:46 +00:00
Philippe Charnier 236d2f5583 Add usage(). Use err(3) instead of local redefinition. 1997-08-08 12:24:49 +00:00
Rodney W. Grimes 9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00