From: Karel Zak <kzak@redhat.com>
To: util-linux@vger.kernel.org
Cc: "Rick van Rein" <rick@openfortress.nl>,
"Asbjørn Sloth Tønnesen" <asbjorn@asbjorn.st>
Subject: script(1) plans
Date: Mon, 18 Mar 2019 13:53:22 +0100 [thread overview]
Message-ID: <20190318125322.4obb27vwtxfuwuie@ws.net.home> (raw)
Hi all,
I'd like to improve script(1) to be more flexible and support more
streams. The current version allow to log only output, but I'd like to
add possibility to log input, signals and more details about the
session.
The idea is to introduce a new timing file format; and use it in case
a new features are requested by user on script(1) command line. The
new format will be still based on text and easy to convert to the old
version.
* New options:
--log-out <file> log output to <file>
--log-in <file> log input to <file>
--log-io <file> log both input and output to <file>
--log-timing <file> timing file (alias to --timing[=<file>])
--no-signal don't log signals
The all --log-* options enables the new format, otherwise old format is used.
script --timing[=<file>] <file> := old timing file format
script --log-timing <file> --log-out <file> := new format
Note that the current --timing uses optional argument and the default
is log timing information to the stderr. This crazy feature will be
deprecated and unsupported for the new --log-timing <file>.
* Another new feature is --json (mutually exclusive to --log-timing), in this
case log data and timing information will be merged together:
{
"version":"2.33.1",
"term":"xterm",
"log": [
{ "type":"in", "delta":1.930626, "data":"ls" },
{ "type":"out", "delta":0.123356, "data":"some crazy data" },
{ "type":"sig", "delta":0.500000, "name":"SIGWINCH", "columns":50, "lines":20 },
...
]
}
* logs redirection (pipe) to another commands:
--log-out-cmd <cmd>
--log-in-cmd <cmd>
--log-io-cmd <cmd>
The redirection will be possible to use with --json too.
* The new (multi-stream) timing file format:
<type> <timestamp> [<offset> | <signal> ...]
# comment
H NAME=<value>
H ...
O 0.001296 256
S 0.001297 SIGWINCH: columns=50, lines=20
I 0.000010 10
H : header (VERSION=, TERM=, STARTTIME=, EXITCODE=, COLUMNS=, LINES=, COMMAND= ...)
O : output
I : input
S : signal
Conversion to the old version:
awk '/^O / { print $2" "$3 }'
* scriptreplay(1) will be extended to autodetect and support the new format and
print summary about the session, new options:
--summary print details from headers (like TERM=, ...)
--play-input print input only
--play-output (default)
* new command scriptlive(1)
- create a new session (slave/master pty) with shell/command to repeat previously
recorded session on a real shell/command.
- for example you can record session (with --log-in) on one machine, repeat
later on another machine(s)
The target release will be probably v2.35 and I'm going to start work
on it ASAP (probably this or next week).
Comments & objections?
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next reply other threads:[~2019-03-18 12:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 12:53 Karel Zak [this message]
2019-03-18 21:10 ` script(1) plans Martin Steigerwald
2019-03-19 7:30 ` Fabian.Kirsch
2019-03-19 7:53 ` Rick van Rein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190318125322.4obb27vwtxfuwuie@ws.net.home \
--to=kzak@redhat.com \
--cc=asbjorn@asbjorn.st \
--cc=rick@openfortress.nl \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).