aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/script
Commit message (Collapse)AuthorAgeFilesLines
* script: handle terminal resize on SIGWINCHKyle Evans2024-04-292-9/+58
| | | | | | | | | | | | 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. (cherry picked from commit 8ceac8e13dccbe4e177c8f2f443b87b7d2e3edb3)
* script: minor style improvementsXavier Beaudouin2024-04-291-8/+10
| | | | | | | | | | | Fix some nits pointed out by checkstyle9.pl in advance of functional changes to script(1). Reviewed by: des Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. (cherry picked from commit 4459abe334eb4dbd416fa8094a64afc065ccd1cc)
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-1/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* script: Handle a missing 's' stamp gracefully.Dag-Erling Smørgrav2022-10-271-0/+2
| | | | | Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37182
* script: Further usage string nits.Dag-Erling Smørgrav2022-10-271-2/+2
| | | | | Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37177
* script: Use size_t / ssize_t where needed.Dag-Erling Smørgrav2022-10-271-3/+3
| | | | | Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37177
* script: Add usage string for playback mode.Dag-Erling Smørgrav2022-10-271-0/+2
| | | | | Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37138
* script: Correct -F in man page and usage string.Dag-Erling Smørgrav2022-10-272-5/+4
| | | | | | Sponsored by: Klara, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37138
* script: use %n at the end of default tstamp_fmtSimon J. Gerraty2022-03-102-2/+4
| | | | | Since we are only outputting time-stamps when they differ ending it with a newline, interferes with the output less.
* script -T skip timstamps for same secondSimon J. Gerraty2022-03-101-3/+8
| | | | | The result is much more readable if we only output the time-stamp when it is at least 1s since last one.
* script add -T fmt to print time-stampsSimon J. Gerraty2022-03-092-10/+44
| | | | | | | | | | | | | | | | | 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
* script(1): work around slow reading childKonstantin Belousov2022-01-101-5/+51
| | | | | | | | | | | | | | | | | | | | If child is slow reading from its input, or even completely stops doing the read, script(1) hangs in write(2) to the pts master waiting until there is a space in the terminal discipline buffer. This also stops handling any outer io, as well as child output. Work around the problem by making pts master fd non-blocking, and be prepared for short writes to it. The data to be written to master is buffered in the tailq which is processed when select(2) detects that master is ready for write. PR: 260938 Reported by: наб <nabijaczleweli@nabijaczleweli.xyz> See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003095 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33789
* Add some examples to script.1Mateusz Piotrowski2021-01-051-2/+68
| | | | | | | | | | | 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
* Improve readability of the options listMateusz Piotrowski2021-01-051-2/+2
| | | | MFC after: 3 days
* Fix typo in comment.Warner Losh2020-09-051-1/+1
| | | | | | | Noticed by: bapt@ Notes: svn path=/head/; revision=365358
* Bump date for r365052Warner Losh2020-09-011-1/+1
| | | | Notes: svn path=/head/; revision=365053
* Have script accept and ignore -e for Linux compatWarner Losh2020-09-012-2/+10
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=365052
* script: Minor cleanups.Mark Johnston2020-08-111-10/+9
| | | | | | | | | | | | | | | - Instead of using isatty() to decide whether to call tcgetattr(), just call tcgetattr() directly, since that's all that isatty() does anyway. - Simplify error handling in termset(). Check for errno != ENOTTY from tcgetattr() to handle errors that may be raised while running script(1) under a debugger. PR: 248377 Submitted by: Soumendra Ganguly <soumendraganguly@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=364112
* script: Put the terminal in raw mode when playing back a session.Mark Johnston2020-08-071-0/+30
| | | | | | | | | | | | Otherwise recorded sessions of some interactive programs do not play back properly. PR: 248377 Submitted by: Soumendra Ganguly <0.gangzta@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=364039
* 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