Commit Graph

20 Commits

Author SHA1 Message Date
Karel Zak 6343ee8c10 script: record exit code
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-14 13:51:01 +02:00
Fred Mora aefe989338 script: add the -o/--output-limit option. Fix race test.
When script is used on a host with a relatively small free disk space, it
is sometimes desirable to limit the size of the captured output. This
can now be enforced with the --output-limit option.

The --output-limit option lets the user specify a maximum size. The program
uses the size parsing from strutils and thus supports the usual
multiplicative suffixes (kiB, KB, MiB, MB, etc.). After the specified
number of bytes have been written to the output file, the script program
will terminate the child process.

Due to buffering, the size of the output file might exceed the specified
limit. This limit also does not include the start and done messages.

The race test was throwing an error dur to a variable being "" in some cases.
Quoting the variable in the equal test took care of that test.

[kzak@redhat.com: - use done() to stop script
                  - count also timing file
                  - remove unnamed member initialization in ctl struct
                  - add to bash-completion]

Signed-off-by: Fred Mora <fmora@datto.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-14 11:32:23 +02:00
Antonio Ospite 3cf274c9e9 script: fix ambiguity about the optional argument of the -t option
[kzak@redhat.com: - merge two patches from Antonio to the one,
                  - update the patch]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Antonio Ospite <ao2@ao2.it>
2017-07-18 14:29:07 +02:00
Karel Zak 6f3c9c3430 script: always write stat and done message to typescript file
And remove usec from timestamp.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-18 12:12:44 +02:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Michael Kerrisk (man-pages) f053ff1e3a Place SEE ALSO entries in order
This patch does only the following:

* Order SEE ALSO entries first by section name, then alphabetically
  within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
  at the end of SEE ALSO lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Benno Schulenberg c8a550a178 script: tweak spacing and wording, and restore filling in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-17 12:18:53 +01:00
Karel Zak 63ddc7ba1e script: add note to BUGS man page section
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-25 11:55:42 +02:00
Stanislav Brabec ab52a8bcce script.1: Improve documentation of non-interactive behavior
- use exit in .profile to avoid non-logged session after typing "exit"
- document that script can read more from stdin than the command inside:

echo -e 'script -c "read a b ; echo a=\$a b=\$b >defs.sh"\n1 2\necho Done' | sh
Script started, file is typescript
1 2
echo Done
Script done, file is typescript
2015-02-16 10:49:36 +01:00
Stanislav Brabec 8fd4a7aa81 script: no logging for non-interactive shells
Karel Zak wrote:

> Would be better to learn people to fix their shell initialization
> files to not call script(1) for non-interactive sessions?

It makes sense.

From 8fff32e65399ae07f70e12568d4d5278725673a7 Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec@suse.cz>
Date: Wed, 11 Feb 2015 15:02:10 +0100
Subject: [PATCH] script.1: Document behavior in non-interactive shells

And discourage users from such use.
2015-02-12 14:31:16 +01:00
Benno Schulenberg 6e72fa5965 docs: bring a few more man pages closer to standard formatting
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-16 12:03:25 +02:00
James Hunt 1474c09ea8 script: --quiet option is not quiet.
Specifying 'script --quiet ...' still produces the 'Script started'
message in the typescript file. The --quiet option implies that the
script program should not log any of its output to the typescript file.

Originally reported at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693966

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-06-23 11:31:07 +02:00
Benno Schulenberg b4362b6f84 docs: standardize the phrases for --help and --version in all man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15 10:28:30 +02:00
Sami Kerola c5e7b9fa70 docs: align script.1 with howto-man-page.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-10-03 20:32:45 +02:00
Benno Schulenberg 62246430f3 docs: also uniformize headers and footers of troff-formatted man pages
Add two spaces as the required third argument of the date line to make
the specified date get used instead of today's date.  Incorporate the
section number into the page title, then use an empty section number,
so that specifying an explicit section/volume name will work.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:39 +02:00
Benno Schulenberg 232dc924c4 docs: uniformize the header and footer lines in man pages
Use dates without the day, use the full month name, put "util-linux" in
the lower left corner, and "User Commands" or "System Administration"
at the top center.

Also improve here and there the one-line program description.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-22 10:39:21 +02:00
Benno Schulenberg 73bc3206bc script: normalize formatting of the man page
Also improve the description of the --timing option,
and discard a then superfluous paragraph.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-15 15:49:50 +02:00
Sami Kerola fd4c1f632f script: option --force added
The --force will allow default output destination, e.g.
typescript file, to be hard or symbolic link.

[kzak@redhat.com: - remove "error:" prefix from errx()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-29 11:22:14 +02:00
Sami Kerola 7ca59ef25f script: optional timing output file argument added
And update to manual page accordingly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 14:21:36 +02:00
Karel Zak c76d33bacc build-sys: move script and scriptreplay to term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 14:06:23 +01:00