How to generate HTML page from UNIX script out-put?

Hi All.

This my first post to this forum, and i assuming it will be best out-of all.

I am quite new to Unix scripting so please excuse me for any silly questions -

I am trying to create on Unix script in which it telnet to my server, check the connectivity of the server and then it generate the out-put.

I am getting correct output and everything is fine.

Now i want to extend that to some extend -

Now i want to the output of the script i should get in HTML formats in email.

conct_asap () {
cd ${home}
 telnet 10.97.111.111 40003 >tap <<EOF
^]
quit
EOF
}
conct_asap 2>asap.log 1>asap.log

grep "Connected" ${home}/asap 2>/dev/null 1>/dev/null
clear
if [ $? -eq 0 ];then
 echo "1]. ${bold}ASAP Check${unbold}"
 echo "_________________________________"
 echo "Connectivity --> UP and Running"

-----------------------------------------------------------------------
So will it possible to generate HTML out-put and send to my mail box ?:wall:

Try something like:

{
     echo "<html><body>"
     echo "1. � <b>ASAP Check</b><br>"
     echo "<hr><br>"
     echo "Connectivity --> UP and Running"
     echo "</body></html>"
} | mailx -m -s "Subject 
Content-Type: text/html" user@domain.com

In the function you write a file "tap" which you never use subsequently. Instead you use a file "asap.log", which should be filled with the <stdout> of the function, but there is none, as the only possible output is redirected to "tap".

Your script contains severe syntax errors ("if" without a closing "fi") and can never have run the way you present it.

Look at any HTML-document and you will notice that it is clear text with a fixed structure and tags mixed with the text. Search the web for any HTML reference (there is an abundance of them) and most of them will not only explain the general structure of such an HTML file but also the meaning of every tag. Consult such a reference/introduction and write such a file using "print" (if you use ksh) or "echo" (if you use bash) or whatever output command your shell has - finished.

I hope this helps.

bakunin