aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/script
Commit message (Collapse)AuthorAgeFilesLines
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=314436
* Directly set the O_CLOEXEC flags via the open(2) attributesBaptiste Daroussin2016-04-161-6/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=298112
* Record command exit status in the typescript file when running simple commands.Bryan Drewery2016-03-081-3/+9
| | | | | | | | | | | Also capitalize 'command:'. Relnotes: yes MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296526
* Just exit in the child if execve(2) fails.Bryan Drewery2016-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 Notes: svn path=/head/; revision=296525
* Filemon: Attach from the child to avoid racing with the parent attach.Bryan Drewery2016-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 Notes: svn path=/head/; revision=296524
* Fix SEE ALSO.Sergey Kandaurov2015-08-261-3/+3
| | | | | | | | | The history mechanism applies to csh. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=287163
* Add META_MODE support.Simon J. Gerraty2015-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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-272-3/+3
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge headSimon J. Gerraty2014-04-282-7/+22
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ Merge from headSimon J. Gerraty2013-09-051-1/+1
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * \ \ sync from headSimon J. Gerraty2013-04-121-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | Sync from headSimon J. Gerraty2012-11-042-33/+267
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | mdoc: sort SEE ALSO.Joel Dahl2014-12-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=276258
* | | | | | Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-251-2/+2
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* | | | | Bring back r226403, the fix for bin/161526, which was (accidentally?)Mikolaj Golub2014-01-171-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reverted in r238896. PR: bin/161526 Reported by: Karli.Sjoberg slu.se MFC after: 3 days Notes: svn path=/head/; revision=260833
* | | | | Add -F to flush output after each write. With this, I canTom Rhodes2013-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. Notes: svn path=/head/; revision=258955
* | | | MFC'ing to 9.2.David E. O'Brien2013-07-301-1/+1
| |_|/ |/| | | | | | | | Notes: svn path=/head/; revision=253814
* | | Fix version in the .Fx macro.Sergey Kandaurov2013-03-161-1/+1
| |/ |/| | | | | | | | | | | Reported by: <deeptech71@gmail.com> Notes: svn path=/head/; revision=248388
* | Add "-f" to also output filemon(4) information.David E. O'Brien2012-10-262-11/+56
| | | | | | | | Notes: svn path=/head/; revision=242138
* | Don't include both <sys/param.h> & <sys/types.h>.David E. O'Brien2012-10-231-6/+1
| | | | | | | | Notes: svn path=/head/; revision=241972
* | Remove contractions.Joel Dahl2012-10-071-1/+1
| | | | | | | | Notes: svn path=/head/; revision=241331
* | Mention when -d, -p and -r first hit FreeBSD.Brian Somers2012-07-301-2/+4
| | | | | | | | | | | | | | | | | | | | Bump the document date to when the change was made (rather than when the PR was submitted). Suggested by: pluknet Notes: svn path=/head/; revision=238897
* | Add d, p and r switches for recording script sessions with timing dataBrian Somers2012-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 Notes: svn path=/head/; revision=238896
* In r225809 the intention was to send VEOF only once if STDIN was not aMikolaj Golub2011-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 Notes: svn path=/head/; revision=226403
* Fix a few grammar and mdoc nits in script.1Glen Barber2011-09-291-14/+19
| | | | | | | | | | PR: 161088 Submitted by: Ben Kaduk ( kaduk % mit ! edu ) MFC after: 1 week Need-MFC: 225809 Notes: svn path=/head/; revision=225857
* When script(1) reads EOF from input it starts spinning on zero-byteMikolaj Golub2011-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 Notes: svn path=/head/; revision=225809
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-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 Notes: svn path=/head/; revision=216370
* Fix the grammar after I added a second environmental variable.David E. O'Brien2010-09-191-1/+1
| | | | | | | Submitted by: wxs Notes: svn path=/head/; revision=212832
* + Add the SCRIPT environmental variable to the sub-shell. Its value isDavid E. O'Brien2010-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. Notes: svn path=/head/; revision=212770
* Mark functions and variables as static.Ed Schouten2010-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. Notes: svn path=/head/; revision=211394
* Remove WNOHANG flag from wait3().Ed Schouten2010-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 Notes: svn path=/head/; revision=207453
* Improve the change made in the previous commit.Ed Schouten2010-03-111-2/+1
| | | | | | | | doshell() never returns, so there is no need to see whether we are the parent process. Notes: svn path=/head/; revision=205009
* Make script(1) a little less broken.Ed Schouten2010-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 Notes: svn path=/head/; revision=205008
* Remove a warning by adding extra parentheses.Ed Schouten2010-01-021-1/+1
| | | | | | | | GCC generates warnings when using "if (foo = bar)". In this case its use is valid. Notes: svn path=/head/; revision=201384
* Deal with double whitespace.Ruslan Ermilov2004-07-031-1/+1
| | | | Notes: svn path=/head/; revision=131507
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-4/+8
| | | | Notes: svn path=/head/; revision=131491
* Bumped document date.Ruslan Ermilov2004-05-191-2/+2
| | | | | | | Fixed markup nit. Notes: svn path=/head/; revision=129433
* Attempt #2 to fix script(1) if the standard input is closed: If weColin Percival2004-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 Notes: svn path=/head/; revision=125848
* Back out part of 1.21, since it breaks `script interactive-program`. ThisColin Percival2004-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 Notes: svn path=/head/; revision=125101
* Fix SYNOPSIS of manual page, clustering no-arg options correctly.Sheldon Hearn2004-01-222-4/+2
| | | | | | | Sync usage with manpage. Notes: svn path=/head/; revision=124846
* Two fixes for script(1):Colin Percival2004-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) Notes: svn path=/head/; revision=124845
* Introduce arguments the standard way. In .Ar command ..., ... is not anPhilippe Charnier2003-09-071-4/+4
| | | | | | | argument, command is. Notes: svn path=/head/; revision=119851