screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using screen logs


From: Micah Cowan
Subject: Re: using screen logs
Date: Fri, 30 Jan 2009 01:23:59 -0800
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jae Norment wrote:
> I use screen to log sessions where I patch Debian servers.  Screen
> captures ANSI control codes (like positioning and color changes), which
> is probably appropriate, however, I want a version of the logs without
> those codes so that I can open it in a text editor.  I've been told that
> a little perl could help, been directed to 'script', both of which don't
> seem to do the trick that I want.  For the perl solution, I need to know
> too much about the ANSI codes that I want to replace.  Script just
> dumps... there doesn't seem to be a good way to capture without the
> codes...
> 
> Screen is a widely used application, and my use to generate logs of my
> sessions has got to be a fairly popular function of screen... so what is
> everyone else using to make the logs human readable?  ( Ideally, I'd
> like something that will reformat the log either to a file or to a pipe.
> )

I think you can use my Teseq program for this. I was going to give it a
"strip" option, but haven't yet. In the meantime, you could do:

  teseq -DLE screenlog.0 | reseq - -

You can get teseq from ftp.gnu.org/gnu/teseq/.

This has the advantage of stripping out entire escape sequences, where
stripping out only control characters would leave the printable majority
from sequences like \E[31;1m. However, it would still leave
non-escape-sequence control characters in (the main one you'd need to
worry about is probably backspace), so you might want to additionally
pipe it through that sed script that was recommended (after teseq/reseq).

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmCxy8ACgkQ7M8hyUobTrFgZQCeLFOlnmJ8KgG7sKvAy5LSIOsR
AnYAmgMXaR+gR06zHF5TyFORiB+FmFDQ
=KdlU
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]