|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. Code:
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 ?
Last edited by bakunin; 03-01-2013 at 11:02 PM.. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Try something like: Code:
{
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 |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
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 |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Use a UNIX Shell Script to Create an HTML Web Page? | rami abusweilei | AIX | 12 | 12-26-2012 07:05 AM |
| Script To Generate HTML output | Siddheshk | Shell Programming and Scripting | 2 | 11-13-2012 10:53 PM |
| Login page in html on unix | ravi18s | Web Programming | 13 | 07-21-2009 10:52 AM |
| how to generate html file using script? | kittusri9 | Shell Programming and Scripting | 2 | 05-25-2008 11:38 PM |
| Html web page to Unix Connectivity | abhilashnair | UNIX and Linux Applications | 1 | 03-06-2008 09:13 AM |
|
|