Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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