Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Pound for pound, the amoeba is the most vicious animal on earth.


devel / comp.unix.shell / what's better than script(1)?

SubjectAuthor
* what's better than script(1)?Eli the Bearded
+* Re: what's better than script(1)?Keith Thompson
|`- Re: what's better than script(1)?Eli the Bearded
+* Re: what's better than script(1)?Russell Marks
|+- Re: what's better than script(1)?Kenny McCormack
|`- Re: what's better than script(1)?Keith Thompson
+* Re: what's better than script(1)?Spiros Bousbouras
|`* Re: what's better than script(1)?Eli the Bearded
| `* Re: what's better than script(1)?Spiros Bousbouras
|  `- Re: what's better than script(1)?Eli the Bearded
`- Re: what's better than script(1)?Jim Jackson

1
what's better than script(1)?

<eli$2110191630@qaz.wtf>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4501&group=comp.unix.shell#4501

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.unix.shell
Subject: what's better than script(1)?
Date: Tue, 19 Oct 2021 20:30:16 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2110191630@qaz.wtf>
Injection-Date: Tue, 19 Oct 2021 20:30:16 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="7033"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Tue, 19 Oct 2021 20:30 UTC

I use the script(1) program a lot to capture output from things I do. I've
got three situations where I find script lacking. Generally each of
these are separate uses, and I don't need one tool that can do them all.

1. I want to capture stuff and have it saved to disk rapidly, so that
output is not lost in the case of a power interruption. I want text
capture for this.

2. I want to capture stuff and have human readable time stamps, at least
on a line per line basis. If I use "script -r" I can get a capture that
is a binary file with binary time stamps (offset from start of
script, and on a character per character basis). I'll also note that
even using that, I find "script -p" never seems to work right. I have
a capture that is 17 wall clock seconds from start to finish. It
takes 71 seconds to play back as "script -p" or under 0.05 seconds
with "script -dp". Neither is close to a realtime playback.

3. I want to capture output from a curses program and have "cat" work
to reproduce the same output. As an example, consider the BSD games
program "rain". Capture and immediate playback[*] has corrupt output.
It is the same terminal at the same size, so that's ruled out. I
suspect that there are some curses interactive bits (where the
terminal is queried and responds) that are breaking things. The
only fix here might be a terminal definition (terminfo/termcap)
that excludes interactive bits.

Any suggestions?

[*] I'm using a "slowcat" program that adds delays for this. True "cat"
is faster than "script -dp".
https://github.com/Eli-the-Bearded/vt100-slowcat
I really do want to capture "rain" output for that collection.

Elijah
------
hasn't done serious terminal tweaking since using the tvi925 in college

Re: what's better than script(1)?

<877de864x7.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4502&group=comp.unix.shell#4502

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Tue, 19 Oct 2021 15:11:32 -0700
Organization: None to speak of
Lines: 51
Message-ID: <877de864x7.fsf@nosuchdomain.example.com>
References: <eli$2110191630@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="22269cd4dfd2383ac0eb1bcd161b88f0";
logging-data="9279"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+856PyGrNzJSMOKDATI20o"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:1cpXiyRfXN7PLrpNs/gSNpINLkk=
sha1:LFYI2Mpd8CUbCgu0WrPfmGLsVc0=
 by: Keith Thompson - Tue, 19 Oct 2021 22:11 UTC

Eli the Bearded <*@eli.users.panix.com> writes:
> I use the script(1) program a lot to capture output from things I do. I've
> got three situations where I find script lacking. Generally each of
> these are separate uses, and I don't need one tool that can do them all.
>
> 1. I want to capture stuff and have it saved to disk rapidly, so that
> output is not lost in the case of a power interruption. I want text
> capture for this.
>
> 2. I want to capture stuff and have human readable time stamps, at least
> on a line per line basis. If I use "script -r" I can get a capture that
> is a binary file with binary time stamps (offset from start of
> script, and on a character per character basis). I'll also note that
> even using that, I find "script -p" never seems to work right. I have
> a capture that is 17 wall clock seconds from start to finish. It
> takes 71 seconds to play back as "script -p" or under 0.05 seconds
> with "script -dp". Neither is close to a realtime playback.
>
> 3. I want to capture output from a curses program and have "cat" work
> to reproduce the same output. As an example, consider the BSD games
> program "rain". Capture and immediate playback[*] has corrupt output.
> It is the same terminal at the same size, so that's ruled out. I
> suspect that there are some curses interactive bits (where the
> terminal is queried and responds) that are breaking things. The
> only fix here might be a terminal definition (terminfo/termcap)
> that excludes interactive bits.
>
> Any suggestions?
>
> [*] I'm using a "slowcat" program that adds delays for this. True "cat"
> is faster than "script -dp".
> https://github.com/Eli-the-Bearded/vt100-slowcat
> I really do want to capture "rain" output for that collection.

What version of "script" are you using? The version on my system
(Ubuntu, "script" provided by bsdutils) doesn't have the options you
mention. That version has a "-t[file]" or "--timing=[file]" option:

Output timing data to standard error, or to file when given. This
data contains two fields, separated by a space. The first field
indicates how much time elapsed since the previous output. The
second field indicates how many char‐ acters were output this time.
This information can be used to replay typescripts with realistic
typing and output delays.

There's a separate "scriptreplay" command. (I haven't tried it.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: what's better than script(1)?

<eli$2110192147@qaz.wtf>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4503&group=comp.unix.shell#4503

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Wed, 20 Oct 2021 01:49:23 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2110192147@qaz.wtf>
References: <eli$2110191630@qaz.wtf> <877de864x7.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Wed, 20 Oct 2021 01:49:23 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="17335"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Wed, 20 Oct 2021 01:49 UTC

In comp.unix.shell, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Eli the Bearded <*@eli.users.panix.com> writes:
>> 3. I want to capture output from a curses program and have "cat" work
>> to reproduce the same output. As an example, consider the BSD games
>> program "rain". Capture and immediate playback[*] has corrupt output.
>> It is the same terminal at the same size, so that's ruled out. I
>> suspect that there are some curses interactive bits (where the
>> terminal is queried and responds) that are breaking things. The
>> only fix here might be a terminal definition (terminfo/termcap)
>> that excludes interactive bits.
> What version of "script" are you using?

That was with NetBSD's system default. It does not print a version
string. The man page shows a date from 2009, but "NetBSD 9.2" which
is much newer than 2009.

> The version on my system
> (Ubuntu, "script" provided by bsdutils) doesn't have the options you
> mention. That version has a "-t[file]" or "--timing=[file]" option:

Hmm. That does look like a _slightly_ more useful timing method.

> Output timing data to standard error, or to file when given. This
> data contains two fields, separated by a space. The first field
> indicates how much time elapsed since the previous output. The
> second field indicates how many char‐ acters were output this time.
> This information can be used to replay typescripts with realistic
> typing and output delays.
>
> There's a separate "scriptreplay" command. (I haven't tried it.)

I just tried "script -t" / "scriptreplay" with rain, and it's still a
mess. scriptreplay seems to do an even worse job with vi sessions
than the NetBSD "script -r" / "script -p".

Elijah
------
could perl-up something to get line-by-line numbers from the -tfile

Re: what's better than script(1)?

<u4TbJ.1306989$fAMf.1303353@usenetxs.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4504&group=comp.unix.shell#4504

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx05.ams4.POSTED!not-for-mail
From: zgedneil@spam^H^H^H^Hgmail.com (Russell Marks)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
References: <eli$2110191630@qaz.wtf>
Organization: this space intentionally left blank
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
Lines: 47
Message-ID: <u4TbJ.1306989$fAMf.1303353@usenetxs.com>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Wed, 20 Oct 2021 11:29:30 UTC
Date: Wed, 20 Oct 2021 11:29:30 GMT
X-Received-Bytes: 2989
 by: Russell Marks - Wed, 20 Oct 2021 11:29 UTC

Eli the Bearded <*@eli.users.panix.com> wrote:

> I use the script(1) program a lot to capture output from things I do. I've
> got three situations where I find script lacking. Generally each of
> these are separate uses, and I don't need one tool that can do them all.
>
> 1. I want to capture stuff and have it saved to disk rapidly, so that
> output is not lost in the case of a power interruption. I want text
> capture for this.
>
> 2. I want to capture stuff and have human readable time stamps, at least
> on a line per line basis. If I use "script -r" I can get a capture that
> is a binary file with binary time stamps (offset from start of
> script, and on a character per character basis). I'll also note that
> even using that, I find "script -p" never seems to work right. I have
> a capture that is 17 wall clock seconds from start to finish. It
> takes 71 seconds to play back as "script -p" or under 0.05 seconds
> with "script -dp". Neither is close to a realtime playback.
>
> 3. I want to capture output from a curses program and have "cat" work
> to reproduce the same output. As an example, consider the BSD games
> program "rain". Capture and immediate playback[*] has corrupt output.
> It is the same terminal at the same size, so that's ruled out. I
> suspect that there are some curses interactive bits (where the
> terminal is queried and responds) that are breaking things. The
> only fix here might be a terminal definition (terminfo/termcap)
> that excludes interactive bits.
>
> Any suggestions?

For the third case (and in some ways the second), I think ttyrec for
recording and maybe ipbt for playback might be suitable. The Debian
package for ttyrec includes several patches, so it might be preferable
to use that version (or just apply their patches manually).

I do vaguely remember having some issues with colour when I last ran
ipbt, which I don't think I ever looked into. But I think other
players for the ttyrec format exist anyway.

Some links:

http://0xcc.net/ttyrec/
http://deb.debian.org/debian/pool/main/t/ttyrec/ttyrec_1.0.8.orig.tar.gz
http://deb.debian.org/debian/pool/main/t/ttyrec/ttyrec_1.0.8-5.1.debian.tar.xz
https://www.chiark.greenend.org.uk/~sgtatham/ipbt/

-Rus.

Re: what's better than script(1)?

<skp2uc$3id08$1@news.xmission.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4505&group=comp.unix.shell#4505

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Wed, 20 Oct 2021 12:43:56 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <skp2uc$3id08$1@news.xmission.com>
References: <eli$2110191630@qaz.wtf> <u4TbJ.1306989$fAMf.1303353@usenetxs.com>
Injection-Date: Wed, 20 Oct 2021 12:43:56 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3748872"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Wed, 20 Oct 2021 12:43 UTC

In article <u4TbJ.1306989$fAMf.1303353@usenetxs.com>,
Russell Marks <zgedneil@spam^H^H^H^Hgmail.com> wrote:
....
>For the third case (and in some ways the second), I think ttyrec for
>recording and maybe ipbt for playback might be suitable. The Debian
>package for ttyrec includes several patches, so it might be preferable
>to use that version (or just apply their patches manually).

Yes, I was just about to recommend ttyrec, but you beat me to it.

>I do vaguely remember having some issues with colour when I last ran
>ipbt, which I don't think I ever looked into. But I think other
>players for the ttyrec format exist anyway.
>
>Some links:
>
> http://0xcc.net/ttyrec/
> http://deb.debian.org/debian/pool/main/t/ttyrec/ttyrec_1.0.8.orig.tar.gz
> http://deb.debian.org/debian/pool/main/t/ttyrec/ttyrec_1.0.8-5.1.debian.tar.xz
> https://www.chiark.greenend.org.uk/~sgtatham/ipbt/

Interestingly, ttyrec is in my Debian repository, but ipbt isn't. So,
thanks for the link for that one. I'm reading it now.

--
You know politics has really been turned upside down when you have someone in the
government with a last name of Cheney (Liz, Senator from Wyoming) who is the voice of
reason.

Re: what's better than script(1)?

<8735ov618t.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4506&group=comp.unix.shell#4506

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Wed, 20 Oct 2021 10:43:14 -0700
Organization: None to speak of
Lines: 27
Message-ID: <8735ov618t.fsf@nosuchdomain.example.com>
References: <eli$2110191630@qaz.wtf> <u4TbJ.1306989$fAMf.1303353@usenetxs.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="22269cd4dfd2383ac0eb1bcd161b88f0";
logging-data="30463"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19l3Tt67KuDxCOODlCDBiFX"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:rKYUUnKXBNZeyweRHWTQT/paNUU=
sha1:zz2Ye/T51Sd72EKZVKEE4O1/180=
 by: Keith Thompson - Wed, 20 Oct 2021 17:43 UTC

Russell Marks <zgedneil@spam^H^H^H^Hgmail.com> writes:
[...]
> For the third case (and in some ways the second), I think ttyrec for
> recording and maybe ipbt for playback might be suitable. The Debian
> package for ttyrec includes several patches, so it might be preferable
> to use that version (or just apply their patches manually).
>
> I do vaguely remember having some issues with colour when I last ran
> ipbt, which I don't think I ever looked into. But I think other
> players for the ttyrec format exist anyway.
>
> Some links:
>
> http://0xcc.net/ttyrec/
> http://deb.debian.org/debian/pool/main/t/ttyrec/ttyrec_1.0.8.orig.tar.gz
> http://deb.debian.org/debian/pool/main/t/ttyrec/ttyrec_1.0.8-5.1.debian.tar.xz
> https://www.chiark.greenend.org.uk/~sgtatham/ipbt/

On Ubuntu (and probably Debian and other Debian-derived distributions),
the "ttyrec" package provides the ttyrec and ttyplay commands, and
"ttyplay" command), and the "its-playback-time" package provides the
ipbt command.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: what's better than script(1)?

<Su8+uirS=PbpNbhKh@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4507&group=comp.unix.shell#4507

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!aioe.org!NFyD4+LU+vfu+oVKTmfrbQ.user.46.165.242.91.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Wed, 20 Oct 2021 17:55:35 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <Su8+uirS=PbpNbhKh@bongo-ra.co>
References: <eli$2110191630@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="36298"; posting-host="NFyD4+LU+vfu+oVKTmfrbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Organisation: Weyland-Yutani
X-Notice: Filtered by postfilter v. 0.9.2
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Wed, 20 Oct 2021 17:55 UTC

On Tue, 19 Oct 2021 20:30:16 -0000 (UTC)
Eli the Bearded <*@eli.users.panix.com> wrote:
> I use the script(1) program a lot to capture output from things I do. I've
> got three situations where I find script lacking. Generally each of
> these are separate uses, and I don't need one tool that can do them all.
>
> 1. I want to capture stuff and have it saved to disk rapidly, so that
> output is not lost in the case of a power interruption. I want text
> capture for this.

The man page for script on my system says

-f Flush output after each write. This is nice for
telecooperation: One person does `mkfifo foo; script -f foo'
and another can supervise real-time what is being done using
`cat foo'.

[...]

> 3. I want to capture output from a curses program and have "cat" work
> to reproduce the same output. As an example, consider the BSD games
> program "rain". Capture and immediate playback[*] has corrupt output.
> It is the same terminal at the same size, so that's ruled out. I
> suspect that there are some curses interactive bits (where the
> terminal is queried and responds) that are breaking things. The
> only fix here might be a terminal definition (terminfo/termcap)
> that excludes interactive bits.

I don't recall ever seeing any terminfo capabilities which are for querying
the terminal. Some terminal emulators provide some escape sequences of their
own. In any case , it seems to me that your quickest option is to examine the
source code of rain (which should be very short) and see if there's anything
which would cause it not to play nice with your slowcat .

Also

rain -d 100 | tee some-file

works for me to the extent that I see the usual rain output on the terminal
and some-file gets some escape sequences. Have you tried your slowcat with
such a set-up ?

> Any suggestions?
>
> [*] I'm using a "slowcat" program that adds delays for this. True "cat"
> is faster than "script -dp".
> https://github.com/Eli-the-Bearded/vt100-slowcat
> I really do want to capture "rain" output for that collection.

I'm going on a tangent but does slowcat handle correctly the animations at
http://vt100.net/dec/animation ?

--
vlaho.ninja/prog

Re: what's better than script(1)?

<eli$2110201443@qaz.wtf>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4508&group=comp.unix.shell#4508

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Wed, 20 Oct 2021 18:45:11 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2110201443@qaz.wtf>
References: <eli$2110191630@qaz.wtf> <Su8+uirS=PbpNbhKh@bongo-ra.co>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Wed, 20 Oct 2021 18:45:11 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="11971"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Wed, 20 Oct 2021 18:45 UTC

In comp.unix.shell, Spiros Bousbouras <spibou@gmail.com> wrote:
> Eli the Bearded <*@eli.users.panix.com> wrote:
> > 1. I want to capture stuff and have it saved to disk rapidly, so that
> > output is not lost in the case of a power interruption. I want text
> > capture for this.
> The man page for script on my system says
>
> -f Flush output after each write. This is nice for
> telecooperation: One person does `mkfifo foo; script -f foo'
> and another can supervise real-time what is being done using
> `cat foo'.

mkfifo! Hahaha, the old tricks. But last time I did that I used the
"mknod foo p" method.

Which script is that?

> I don't recall ever seeing any terminfo capabilities which are for querying
> the terminal.

The most commonly used ones are the u[6789] sequenences.

man resize
....

• then resize asks the terminal for its size in characters.
Depending on whether the "-s option is given, resize uses a
different escape sequence to ask for this information.

The resize command sends an cursor position request to go to 999,999
then a cursor enquiry (u6) to get the response from the terminal (u8).
Reading that response, it knows how big the terminal screen is.

https://dickey.his.com/ncurses/terminfo.src.html

> Also
>
> rain -d 100 | tee some-file
>

Hmmm. That didn't do it, but it gave me an idea.

rain -d 100 < /dev/null | tee some-file

That is not 100%, but is 99%. It still has an occaisonal glitch, but
it is mostly working.

> > [*] I'm using a "slowcat" program that adds delays for this. True "cat"
> > is faster than "script -dp".
> > https://github.com/Eli-the-Bearded/vt100-slowcat
> > I really do want to capture "rain" output for that collection.
> I'm going on a tangent but does slowcat handle correctly the animations at
> http://vt100.net/dec/animation ?

Yes. That's exactly the sort of thing it does. And it includes more
videos than that site has.

Elijah
------
remembers when `eval resize` was a useful addition to .profile

Re: what's better than script(1)?

<H0gJ1y9PHx+PZr5Nr@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4509&group=comp.unix.shell#4509

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!aioe.org!NFyD4+LU+vfu+oVKTmfrbQ.user.46.165.242.91.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Thu, 21 Oct 2021 15:17:42 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <H0gJ1y9PHx+PZr5Nr@bongo-ra.co>
References: <eli$2110191630@qaz.wtf> <Su8+uirS=PbpNbhKh@bongo-ra.co>
<eli$2110201443@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="58335"; posting-host="NFyD4+LU+vfu+oVKTmfrbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Thu, 21 Oct 2021 15:17 UTC

On Wed, 20 Oct 2021 18:45:11 -0000 (UTC)
Eli the Bearded <*@eli.users.panix.com> wrote:
> In comp.unix.shell, Spiros Bousbouras <spibou@gmail.com> wrote:
> > Eli the Bearded <*@eli.users.panix.com> wrote:
> > > 1. I want to capture stuff and have it saved to disk rapidly, so that
> > > output is not lost in the case of a power interruption. I want text
> > > capture for this.
> > The man page for script on my system says
> >
> > -f Flush output after each write. This is nice for
> > telecooperation: One person does `mkfifo foo; script -f foo'
> > and another can supervise real-time what is being done using
> > `cat foo'.
>
> mkfifo! Hahaha, the old tricks. But last time I did that I used the
> "mknod foo p" method.
>
> Which script is that?

Debian Linux. Your script doesn't have the -f option ?

> > I don't recall ever seeing any terminfo capabilities which are for querying
> > the terminal.
>
> The most commonly used ones are the u[6789] sequenences.
>
> man resize
> ...
>
> • then resize asks the terminal for its size in characters.
> Depending on whether the "-s option is given, resize uses a
> different escape sequence to ask for this information.
>
> The resize command sends an cursor position request to go to 999,999
> then a cursor enquiry (u6) to get the response from the terminal (u8).
> Reading that response, it knows how big the terminal screen is.
>
> https://dickey.his.com/ncurses/terminfo.src.html

I had some trouble finding on the page the relevant part. It's

# INTERPRETATION OF USER CAPABILITIES
# # The System V Release 4 and XPG4 terminfo format defines ten string
# capabilities for use by applications, <u0>...<u9>. In this file, we use
# certain of these capabilities to describe functions which are not covered
# by terminfo. The mapping is as follows:
# # u9 terminal enquire string (equiv. to ANSI/ECMA-48 DA)
# u8 terminal answerback description
# u7 cursor position request (equiv. to VT100/ANSI/ECMA-48 DSR 6)
# u6 cursor position report (equiv. to ANSI/ECMA-48 CPR)

..Note that it actually says that the specific interpretations are not part
of terminfo. man 5 terminfo gives

user0 u0 u0 User string #0
user1 u1 u1 User string #1
user2 u2 u2 User string #2
user3 u3 u3 User string #3
user4 u4 u4 User string #4
user5 u5 u5 User string #5
user6 u6 u6 User string #6
user7 u7 u7 User string #7
user8 u8 u8 User string #8
user9 u9 u9 User string #9

I didn't read the dickey.his.com page carefully enough to see what he
means by "In this file, we use" .I'm guessing it's some kind of notational
extension specific to the page/file and not part of "standard" terminfo
notation.

[...]

> Elijah
> ------
> remembers when `eval resize` was a useful addition to .profile

I take it that was before the time usual shells automatically set the
COLUMNS and LINES variables. I have in my shell environment the function

dims () { printf 'Lines : %d Columns : %d\n' `tput lines` `tput cols` ; }

That's another method which works.

--
The delight of working in a medium so tractable - pure thought-stuff - which
nevertheless exists, moves, and works in a way that word-objects do not.
"The mythical man-month" by Frederick Brooks

Re: what's better than script(1)?

<eli$2110211321@qaz.wtf>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4510&group=comp.unix.shell#4510

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Thu, 21 Oct 2021 17:21:13 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2110211321@qaz.wtf>
References: <eli$2110191630@qaz.wtf> <Su8+uirS=PbpNbhKh@bongo-ra.co> <eli$2110201443@qaz.wtf> <H0gJ1y9PHx+PZr5Nr@bongo-ra.co>
Injection-Date: Thu, 21 Oct 2021 17:21:13 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="17114"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Thu, 21 Oct 2021 17:21 UTC

In comp.unix.shell, Spiros Bousbouras <spibou@gmail.com> wrote:
> Eli the Bearded <*@eli.users.panix.com> wrote:
>> Which script is that?
> Debian Linux. Your script doesn't have the -f option ?

Actually it does. I don't know how I missed that before.

-f Flush output after each write. This is useful for watching
the script output in real time.

> > then a cursor enquiry (u6) to get the response from the terminal (u8).
> > Reading that response, it knows how big the terminal screen is.
> > https://dickey.his.com/ncurses/terminfo.src.html
> I had some trouble finding on the page the relevant part. It's

Search for u6 and u8 ?

>> remembers when `eval resize` was a useful addition to .profile
> I take it that was before the time usual shells automatically set the
> COLUMNS and LINES variables. I have in my shell environment the function

I can recall SIGWINCH being a new signal.

Elijah
------
resize is an X11 tool (at least these days)

Re: what's better than script(1)?

<slrnsn3fg2.6nd.jj@iridium.wf32df>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=4511&group=comp.unix.shell#4511

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.unix.shell
Subject: Re: what's better than script(1)?
Date: Thu, 21 Oct 2021 19:22:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <slrnsn3fg2.6nd.jj@iridium.wf32df>
References: <eli$2110191630@qaz.wtf>
Injection-Date: Thu, 21 Oct 2021 19:22:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="60c6d3e91ae20a2f563791a44432117a";
logging-data="23572"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xBnRD4MAaoIUf+mE2xk4S/QQGR5xz69A="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:lSkFY2bGQYYGZTAj9H1wXaM7FMg=
 by: Jim Jackson - Thu, 21 Oct 2021 19:22 UTC

On 2021-10-19, Eli the Bearded <*@eli.users.panix.com> wrote:
> 2. I want to capture stuff and have human readable time stamps, at least
> on a line per line basis. If I use "script -r" I can get a capture that
> is a binary file with binary time stamps (offset from start of
> script, and on a character per character basis). I'll also note that
> even using that, I find "script -p" never seems to work right. I have
> a capture that is 17 wall clock seconds from start to finish. It
> takes 71 seconds to play back as "script -p" or under 0.05 seconds
> with "script -dp". Neither is close to a realtime playback.

Not for the faint-of-heart, but if you are an old kermit hand then ...

I've used ckermit when I wanted timestamped lines. I use kermit over
serial lines mainly when connecting to linux based SBCs with serial
console the timestamps are often useful when fine tuning booting. You
can use ssh within kermit, so occasionally when I need to timestamp log
output, I ssh to localhost and do stuff there.

A long time ago I used to script kermit connections so it wasn't _too_
difficult getting back into it.

Not sure it's want you want though.


devel / comp.unix.shell / what's better than script(1)?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor