Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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; ESC[00;34;34m~

which I would like to convert to something like this:

$ exit
Executing .bashrc
<font color=red></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

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


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.