convert cron output to plain text
I have a cron that runs a Perl binary, which generates output in raw HTML code. This output is emailed to me by the cron:
Code:
1 6,12,22 * * * apache /my_script.pl | mail my@email.com -s "My Cron Output" http://deesto.pastebin.com/fdea3fea Is there an easy way (a one-liner in the cron, or that I can add to a bash script) to either strip the HTML tags from the output, or somehow turn this output into valid HTML, so it doesn't look like garbage on the screen? |
Google html2txt
|
Thanks, but there seem to be several incarnations of "html2txt": one is an online script on the W3C site[1], one appears to be a Windows GUI tool[2], one is a Python script that runs only on existing URLs[3], etc. I need something to work with cron/bash in Linux to clean up command output. I'd hoped someone might have a quick command or script to do something similar.
[1] http://cgi.w3.org/cgi-bin/html2txt [2] http://www.bobsoft.com/html2txt/ [3] http://www.aaronsw.com/2002/html2text/ |
Try this one http://www.mbayer.de/html2text/
Depending on which of your distros you are working on, you may find it in your package manager (it's in the RH derivatives for example - see rpmforge repo.). If you use www.google.com/linux, you will find much more targeted results than the general google. |
Thanks billymayday. I downloaded and installed that as an RPM on my system (RHEL4), and it worked without error. However, the output was kind of strange when I sent it to a file:
Code:
-rw-r--r-- 1 root root 47006 Oct 18 2006 install.log Code:
W^HWe^Heb^Hb:^H Code:
html2text -ascii -nobs -o [output.file] [input.file] |
You're welcome
|
All times are GMT -5. The time now is 07:26 AM. |