[vox-tech] Re: help with script

vox-tech@lists.lugod.org vox-tech@lists.lugod.org
Fri, 4 Oct 2002 14:33:12 -0400


On Thu, Oct 03, 2002 at 01:52:27PM -0700, Ken Bloom wrote:
> > From: Peter Jay Salzman <p@dirac.org>
> > for #2, i'm having them use "script".
[...]
> >    ^[]0;dhevan@jensen:~^G[dhevan@jensen dhevan]$ cc program1.c^M
> >    ^[]0;dhevan@jensen:~^G[dhevan@jensen dhevan]$ exit^M
>      ^^^^^^^^^^^^^^^^^^^^^^
>      Judging from this sequence, it looks like the work was done in an
>      xterm.
[...]
> However, there is the interesting problem of what to do with the control
> codes that `script' leaves in its output. There's a good answer to this:
> b) don't try to run the document through less (at least not without

less -r
  (but this isn't perfect since it's the same as the cat you recommend below)

> Instead of either of these two strategies, open an xterm with a
> sufficiently large scrollback buffer, then cat the whole file into the
> xterm. Examine it in the xterm.

  I guess a minor problem is you see the final output... anytime anything
runs that clears the screen the viewable text gets cleared.  For example
when the following is run in a directory with less than 20 files in it.
====
script foo
ls -l
^Lls
^D
cat foo
====
you will only see the output from the final ls, because when the screen is
cleared by the ^L, all of the ls -l output goes away.

> If anyone knows of a program that can actually parse these annoyances out
> of the script output, I think that's what we're really looking for here.

Documentation of the xterm control sequences are available here...
===
/usr/share/doc/xterm/ctlseqs.txt.gz
/usr/share/doc/xterm/ctlseqs.ps.gz
===
both part of the "xterm" package on Debian.

... also I see that xterm has a "log" option available (which appears to
be  compile time disabled on Debian), if I can find the disk space I'll
see if that option has the same problem as "less -r" and the "cat" solution 
mentioned above.

  TTFN,
    Mike