bash ansi codes to html for html reports from shell script

2017-02-20 103 words 1 min read

How many times you have felt that there was some simple way to convert bash ansi escape sequences ( colors as well in terminal ) to html equivalent so that you can send the same as html report in email. Here is simple solution. One way is to use ccze if you are using this for logs – colorize your logs and for more generic solution.

 

dnf install python3-ansi2html.noarch

after this is installed, you can use something like this:

/usr/bin/python3-ansi2html -l -f 12 -i

You can see the help for ansi2html to see what parameters mean and which ones suit you best 🙂


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it