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.


The query you need is convert ansi to html. Here is a Perl package that seems to do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.