Convert shell logs (incl. escape characters) to HTML?

Posted by dehmann on Super User See other posts from Super User or by dehmann
Published on 2010-03-06T22:15:54Z Indexed on 2010/03/12 19:17 UTC
Read the original article Hit count: 255

Filed under:
|
|

Is there tool or a regexp that can convert shell escape characters to HTML code?

As an example, here is a logfile from GNU screen:

^MESC[K$ ^MESC[K$ exit
Executing .bashrc
ESC[00;31;31mserver.xyz.com: ESC[00;34;34m~

which I would like to convert to something like this:

$ exit
Executing .bashrc
<font color=red>server.xyz.com</font>: <font color=blue>~</font>

and send as HTML e-mail to an e-mail address, to archive my work.

Here is a related question, which shows how to convert it to regular text, but it would be nice to convert to HTML and not just throw the escape characters away.

© Super User or respective owner

Related posts about gnu-screen

Related posts about linux