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 🙂
Related Articles:
- 2014/10/06 nall – schedule your tasks like a pro
- 2013/10/04 Home grown mail scheduler with bash script and cron
- 2010/06/25 wordpress blog stats monitoring from remote using curl and bash and send it in mail.
- 2010/06/02 Logwatch for Linux Systems.
- 2010/05/27 Checking the links to your site (from affiliates) using cron and bash script.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.