History log of /freebsd-10.0-release/usr.bin/script/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


253814 30-Jul-2013 obrien

MFC'ing to 9.2.


248388 16-Mar-2013 pluknet

Fix version in the .Fx macro.

Reported by: <deeptech71@gmail.com>


242138 26-Oct-2012 obrien

Add "-f" to also output filemon(4) information.


241972 23-Oct-2012 obrien

Don't include both <sys/param.h> & <sys/types.h>.


241331 07-Oct-2012 joel

Remove contractions.


238897 30-Jul-2012 brian

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


238896 30-Jul-2012 brian

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


226403 15-Oct-2011 trociny

In r225809 the intention was to send VEOF only once if STDIN was not a
terminal. Unfortunately the fix was incorrect and for flushtime > 0 it
keept sending VEOF.

Sent VEOF generates ^D\b\b echoed by the terminal, which was reported
in bin/161526. Note, we still send VEOF at least once. Otherwise
commands like below would hang forever:

echo 1 |script /tmp/script.out cat

PR: bin/161526
Reported by: Adrian Wontroba <aw1@stade.co.uk>, Stefan Bethke <stb@lassitu.de>
Tested by: Stefan Bethke <stb@lassitu.de>
MFC after: 3 days


225857 29-Sep-2011 gjb

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


225809 27-Sep-2011 trociny

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


216370 11-Dec-2010 joel

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


212832 19-Sep-2010 obrien

Fix the grammar after I added a second environmental variable.

Submitted by: wxs


212770 16-Sep-2010 obrien

+ 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.


211394 16-Aug-2010 ed

Mark functions and variables as static.

All these functions and variables are local to this compilation unit, so
there is no reason why we shouldn't mark them static. This slightly
reduces the binary size.


207453 30-Apr-2010 ed

Remove WNOHANG flag from wait3().

Because script(1) now reliably terminates when the TTY is closed, it may
be the case that the call to wait3() occurs just before the child
process exits. This causes error codes to be ignored.

Just change script(1) to use waitpid() instead of wait3(). This makes it
more portable and prevents the need for a loop, since waitpid() only
returns a specified process.

PR: bin/146189
Tested by: amdmi3@, older version
MFC after: 2 weeks


205009 11-Mar-2010 ed

Improve the change made in the previous commit.

doshell() never returns, so there is no need to see whether we are the
parent process.


205008 11-Mar-2010 ed

Make script(1) a little less broken.

Close the file descriptor to the TTY. There is no reason why the parent
process should keep track of the descriptor. This ensures that the
application inside properly drains the TTY during exit(2).

Reported by: alfred
MFC after: 2 weeks


201384 02-Jan-2010 ed

Remove a warning by adding extra parentheses.

GCC generates warnings when using "if (foo = bar)". In this case its use
is valid.


131507 03-Jul-2004 ru

Deal with double whitespace.


131491 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


129433 19-May-2004 ru

Bumped document date.
Fixed markup nit.


125848 15-Feb-2004 cperciva

Attempt #2 to fix script(1) if the standard input is closed: If we
read EOF from STDIN_FILENO, write zero bytes into the pseudo-terminal;
this is interpreted as an EOF by the program being scripted.

I've tested this with two non-interactive scripts:
# echo 5 | script foo sh -c 'read x; sleep $x; echo bar'
# echo bar | xargs script foo echo
and one interactive program:
# script foo more /etc/passwd
and everything seems to work properly...

PR: bin/56166, bin/57414, ports/57415, ports/60534
Approved by: rwatson (mentor)
MFC after: 2 weeks


125101 27-Jan-2004 cperciva

Back out part of 1.21, since it breaks `script interactive-program`. This
re-breaks non-interactive portupgrade (or at least old versions of
portupgrade); I'll see if I can put together a solution which avoids
breaking anything later.

Approved by: rwatson (mentor)
Noticed by: Stefan Farfeleder, Joshua Goodall


124846 22-Jan-2004 sheldonh

Fix SYNOPSIS of manual page, clustering no-arg options correctly.

Sync usage with manpage.


124845 22-Jan-2004 cperciva

Two fixes for script(1):
1. Don't do tty stuff to stdin if stdin isn't a tty.
2. When running in non-interactive mode, don't select(2)
on the standard input.

This un-breaks non-interactive portupgrade.

PR: bin/59036 [1]
PR: bin/56166, bin/57414, ports/57415, ports/60534 [2]
MFC after: 7 days
Approved by: rwatson (mentor)


119851 07-Sep-2003 charnier

Introduce arguments the standard way. In .Ar command ..., ... is not an
argument, command is.


102944 04-Sep-2002 dwmalone

ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by: md5


97788 03-Jun-2002 mike

Use POSIX macros for wait(2)-style status information instead of the
deprecated 4.2/4.3BSD wait union. Fix some nearby pid_t/int
confusion.


95124 20-Apr-2002 charnier

Use `The .Nm utility'


92922 22-Mar-2002 imp

remove __P


87768 12-Dec-2001 markm

Minor style stuff, use __FBSDID(), remove to-be-default WARNS=2.


87628 10-Dec-2001 dwmalone

Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.


87296 03-Dec-2001 dwmalone

Warns cleanups. Add FreeBSD ID.


80381 26-Jul-2001 sheldonh

Use STD{ERR,IN,OUT}_FILENO instead of their numeric values. The
definitions are more readable, and it's possible that they're
more portable to pathalogical platforms.

Submitted by: David Hill <david@phobia.ms>


79755 15-Jul-2001 dd

Remove whitespace at EOL.


79535 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


79452 09-Jul-2001 brian

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


78737 24-Jun-2001 dd

Nuke unused variables.


68963 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


62897 10-Jul-2000 kris

Don't call warn() with no format string.


57786 06-Mar-2000 green

Make a run-on sentence into two proper sentences, and clarify the meaning
a bit.


57695 02-Mar-2000 sheldonh

Remove more single-space hard sentence breaks.


57670 01-Mar-2000 sheldonh

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.


54579 13-Dec-1999 billf

Fix grammar error. (missing verb)


53670 24-Nov-1999 guido

Adjust man page: if command is specified, file name is mandatory


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49646 11-Aug-1999 sheldonh

Pass as argv[0] the name of the shell executed instead of "sh".

PR: 2851
Reported by: era@iki.fi
Obtained from: NetBSD


39741 29-Sep-1998 jkoshy

Mention default time between output flushes in manual page.

PR: docs/8009
Submitted by: Stefan Eggers <seggers@semyam.dinoco.de>


39481 19-Sep-1998 des

Fix the following bugs:

- if a command was specified and script(1) failed to execute it,
it would print the name of your shell in the error message
instead of that of the command that failed.

- since finish() was installed as a SIGCHLD handler, it would
often run before the main loop had had time to process the
last few bytes of output. This resulted in very strange
truncated error messages.

- script(1) would almost always return with an exit status of 0,
even if the command returned a non-zero exit status. This broke
my 'build world, install it and rebuild the kernel' scripts
because 'make installworld' would run even if 'make buildworld'
had failed.


36649 04-Jun-1998 steve

Fix a bunch of spelling errors.

PR: 6856
Submitted by: Josh Gilliam <josh@quick.net>


34295 08-Mar-1998 peter

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.


32108 30-Dec-1997 peter

Fix typo while copying patch from the 2.2 system that it came from
Use execvp rather than execv so that full paths are not needed.


32083 29-Dec-1997 peter

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.


27980 08-Aug-1997 charnier

Add usage(). Use err(3) instead of local redefinition.


24360 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


18286 14-Sep-1996 bde

Don't use __dead or __pure in user code. They were obfuscations
for gcc >= 2.5 and no-ops for gcc >= 2.6. Converted to use __dead2
or __pure2 where it wasn't already done, except in math.h where use
of __pure was mostly wrong.


9987 07-Aug-1995 wollman

Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.


1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.