| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit cccdaf507eee8fb34494b4624eb85bb951e323c8)
|
| |
|
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Similar commit in main:
(cherry picked from commit 1d386b48a555)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sponsored by: Klara, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D37138
(cherry picked from commit 8e096e24d4344b6d3d16e24d58d5d8a0fa9733c9)
script: Add usage string for playback mode.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37138
(cherry picked from commit e7c13cf4383d8216149becf7f843a2e00b30d2e2)
script: Use size_t / ssize_t where needed.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37177
(cherry picked from commit 3276866f40caaf3d5605d5695f460cbdf035ef45)
script: Further usage string nits.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37177
(cherry picked from commit 6ac087cf8ff4de22dc0b1b7ce1248f0a1558ddc2)
script: Handle a missing 's' stamp gracefully.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37182
(cherry picked from commit 473e9fcab4ea9379f53e1f7d8e41f5a5754d0007)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 6c4afed5667a65f3c5bd308a934e7de8c0526954)
script -T skip timstamps for same second
The result is much more readable if we only output the time-stamp
when it is at least 1s since last one.
(cherry picked from commit 7b45ad3f89cc4d65a23f7d034329dd3f8dd3105f)
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.
(cherry picked from commit 31fde973577d0e09caccf0d762135bfa6b14f1f3)
|
| |
|
|
|
|
| |
PR: 260938
(cherry picked from commit c0ba4c2ee2c48ec9892d10c0aca797f3685c53ee)
|
| |
|
|
|
|
|
| |
Noticed by: bapt@
Notes:
svn path=/head/; revision=365358
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=298112
|
| |
|
|
|
|
|
|
|
|
|
| |
Also capitalize 'command:'.
Relnotes: yes
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=296526
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
reverted in r238896.
PR: bin/161526
Reported by: Karli.Sjoberg slu.se
MFC after: 3 days
Notes:
svn path=/head/; revision=260833
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Notes:
svn path=/head/; revision=242138
|
| |
|
|
| |
Notes:
svn path=/head/; revision=241972
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
doshell() never returns, so there is no need to see whether we are the
parent process.
Notes:
svn path=/head/; revision=205009
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
GCC generates warnings when using "if (foo = bar)". In this case its use
is valid.
Notes:
svn path=/head/; revision=201384
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Sync usage with manpage.
Notes:
svn path=/head/; revision=124846
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=102944
|
| |
|
|
|
|
|
|
| |
deprecated 4.2/4.3BSD wait union. Fix some nearby pid_t/int
confusion.
Notes:
svn path=/head/; revision=97788
|
| |
|
|
| |
Notes:
svn path=/head/; revision=92922
|
| |
|
|
| |
Notes:
svn path=/head/; revision=87768
|
| |
|
|
| |
Notes:
svn path=/head/; revision=87296
|
| |
|
|
|
|
|
|
|
|
| |
definitions are more readable, and it's possible that they're
more portable to pathalogical platforms.
Submitted by: David Hill <david@phobia.ms>
Notes:
svn path=/head/; revision=80381
|
| |
|
|
|
|
|
| |
Idea from: Theo de Raadt <deraadt@openbsd.org>
Notes:
svn path=/head/; revision=79452
|
| |
|
|
| |
Notes:
svn path=/head/; revision=78737
|
| |
|
|
| |
Notes:
svn path=/head/; revision=62897
|
| |
|
|
| |
Notes:
svn path=/head/; revision=50477
|
| |
|
|
|
|
|
|
|
| |
PR: 2851
Reported by: era@iki.fi
Obtained from: NetBSD
Notes:
svn path=/head/; revision=49646
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
Notes:
svn path=/head/; revision=39481
|
| |
|
|
|
|
|
|
| |
This allows simple logging of keys sent to a session (turned on with -k).
Also allow specifying the script file flush interval.
Notes:
svn path=/head/; revision=34295
|
| |
|
|
|
|
|
| |
Use execvp rather than execv so that full paths are not needed.
Notes:
svn path=/head/; revision=32108
|
| |
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=32083
|