summaryrefslogtreecommitdiffstats
path: root/usr.bin/script
Commit message (Collapse)AuthorAgeFilesLines
* Directly set the O_CLOEXEC flags via the open(2) attributesbapt2016-04-161-6/+3
| | | | MFC after: 1 week
* Record command exit status in the typescript file when running simple commands.bdrewery2016-03-081-3/+9
| | | | | | | | Also capitalize 'command:'. Relnotes: yes MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Just exit in the child if execve(2) fails.bdrewery2016-03-081-9/+1
| | | | | | | | | | | | | | No functional change. This is mostly addressing a false-positive from the clang static analyzer due to it thinking that done() was being called with freed memory, however the kill(0, SIGTERM) made the done() never reached. It doesn't make sense to the show the footer from the child anyhow, nor does it make sense to kill the process group here since the execve(2) failed in the child. This code was leftover from many years of refactoring. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Filemon: Attach from the child to avoid racing with the parent attach.bdrewery2016-03-081-4/+10
| | | | | | | | | | This is the same as how the bmake filemon usage works. This also fixes failed attach not properly flushing the TTY. MFC after: 1 week Relnotes: yes Sponsored by: EMC / Isilon Storage Division
* Fix SEE ALSO.pluknet2015-08-261-3/+3
| | | | | | The history mechanism applies to csh. Sponsored by: Nginx, Inc.
* Add META_MODE support.sjg2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-272-3/+3
| |\ | |/ |/|
| * Updated dependenciessjg2014-05-161-1/+0
| |
| * Updated dependenciessjg2014-05-101-0/+2
| |
| * Merge headsjg2014-04-282-7/+22
| |\
| * \ Merge from headsjg2013-09-051-1/+1
| |\ \
| * \ \ sync from headsjg2013-04-121-1/+1
| |\ \ \
| * | | | Updated dependenciessjg2013-03-111-0/+1
| | | | |
| * | | | Updated dependenciessjg2013-02-161-2/+0
| | | | |
| | | | |
| | \ \ \
| *-. \ \ \ Sync from headsjg2012-11-042-33/+267
| |\ \ \ \ \
| * | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+20
| | |/ / / / | |/| | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | mdoc: sort SEE ALSO.joel2014-12-261-1/+1
| | | | | |
* | | | | | Convert to usr.bin/ to LIBADDbapt2014-11-251-2/+2
| |_|_|_|/ |/| | | | | | | | | | | | | | Reduce overlinking
* | | | | Bring back r226403, the fix for bin/161526, which was (accidentally?)trociny2014-01-171-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reverted in r238896. PR: bin/161526 Reported by: Karli.Sjoberg slu.se MFC after: 3 days
* | | | | Add -F to flush output after each write. With this, I cantrhodes2013-12-052-4/+16
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | MFC'ing to 9.2.obrien2013-07-301-1/+1
| |_|/ |/| |
* | | Fix version in the .Fx macro.pluknet2013-03-161-1/+1
| |/ |/| | | | | Reported by: <deeptech71@gmail.com>
* | Add "-f" to also output filemon(4) information.obrien2012-10-262-11/+56
| |
* | Don't include both <sys/param.h> & <sys/types.h>.obrien2012-10-231-6/+1
| |
* | Remove contractions.joel2012-10-071-1/+1
| |
* | Mention when -d, -p and -r first hit FreeBSD.brian2012-07-301-2/+4
| | | | | | | | | | | | | | Bump the document date to when the change was made (rather than when the PR was submitted). Suggested by: pluknet
* | Add d, p and r switches for recording script sessions with timing databrian2012-07-302-24/+216
|/ | | | | | | | and playing sessions back with or without time delays. PR: 114465 Submitted by: ighighi at gmail dot com MFC after: 3 weeks
* In r225809 the intention was to send VEOF only once if STDIN was not atrociny2011-10-151-3/+6
| | | | | | | | | | | | | | | | 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
* Fix a few grammar and mdoc nits in script.1gjb2011-09-291-14/+19
| | | | | | | PR: 161088 Submitted by: Ben Kaduk ( kaduk % mit ! edu ) MFC after: 1 week Need-MFC: 225809
* When script(1) reads EOF from input it starts spinning on zero-bytetrociny2011-09-272-12/+29
| | | | | | | | | | | | | | | | 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
* Remove the advertising clause from UCB copyrighted files in usr.bin. Thisjoel2010-12-112-8/+0
| | | | | | | | | 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
* Fix the grammar after I added a second environmental variable.obrien2010-09-191-1/+1
| | | | Submitted by: wxs
* + Add the SCRIPT environmental variable to the sub-shell. Its value isobrien2010-09-162-0/+20
| | | | | | | | 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.
* Mark functions and variables as static.ed2010-08-161-15/+14
| | | | | | 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.
* Remove WNOHANG flag from wait3().ed2010-04-301-15/+9
| | | | | | | | | | | | | | 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
* Improve the change made in the previous commit.ed2010-03-111-2/+1
| | | | | doshell() never returns, so there is no need to see whether we are the parent process.
* Make script(1) a little less broken.ed2010-03-111-0/+2
| | | | | | | | | 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
* Remove a warning by adding extra parentheses.ed2010-01-021-1/+1
| | | | | GCC generates warnings when using "if (foo = bar)". In this case its use is valid.
* Deal with double whitespace.ru2004-07-031-1/+1
|
* Mechanically kill hard sentence breaks.ru2004-07-021-4/+8
|
* Bumped document date.ru2004-05-191-2/+2
| | | | Fixed markup nit.
* Attempt #2 to fix script(1) if the standard input is closed: If wecperciva2004-02-151-1/+3
| | | | | | | | | | | | | | | | 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
* Back out part of 1.21, since it breaks `script interactive-program`. Thiscperciva2004-01-271-2/+1
| | | | | | | | | 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
* Fix SYNOPSIS of manual page, clustering no-arg options correctly.sheldonh2004-01-222-4/+2
| | | | Sync usage with manpage.
* Two fixes for script(1):cperciva2004-01-221-11/+22
| | | | | | | | | | | | | 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)
* Introduce arguments the standard way. In .Ar command ..., ... is not ancharnier2003-09-071-4/+4
| | | | argument, command is.
* ANSIify function definitions.dwmalone2002-09-041-10/+6
| | | | | | | | | 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
* Use POSIX macros for wait(2)-style status information instead of themike2002-06-031-3/+3
| | | | | deprecated 4.2/4.3BSD wait union. Fix some nearby pid_t/int confusion.
* Use `The .Nm utility'charnier2002-04-201-6/+9
|
OpenPOWER on IntegriCloud