Sponsored Content
Top Forums Shell Programming and Scripting How to generate HTML page from UNIX script out-put? Post 302774421 by HHarsh on Friday 1st of March 2013 10:27:19 PM
Old 03-01-2013
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 ?Smilie

Moderator's Comments:
Mod Comment edit by bakunin: two thirds of your post were redundant FONT-, SIZE-, and whatnot-tags, which i just cleared out. Many thanks for creating that work for me, i wouldn't know what to do the whole day otherwise. The only tag you should have used - the CODE-tag - was missing, so i put it in. Was there anything not understandable in "Please use CODE-tags"? Or was it the button for the CODE-tag, which is so deceptively labeled "CODE"?

Last edited by bakunin; 03-02-2013 at 12:02 AM..
 

10 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Unix Manual (man-page) pages in HTML

LINK: Unix Manual (man page) pages in HTML http://www.rt.com/man/ : More then 100 Commands found on a Unix system mannual pages can be obtained/refered here. Good Link.. (1 Reply)
Discussion started by: killerserv
1 Replies

2. Shell Programming and Scripting

linking unix generated text file to html page

i am trying to link the text files that i generated from my shell script to an html page, to that i can view them using a browser, like internet explorer. i want to open the text files in html page when i enter a command to view the text file from the shell command. please could anyone help... (1 Reply)
Discussion started by: alexd
1 Replies

3. UNIX and Linux Applications

Html web page to Unix Connectivity

Hi All, I need a basic overview of connecting a HTML web page to Unix I will give a brief of my exact requirement. There will be a front end HTML page - a web page which will have certain buttons. Each button will have certain functionality. For eg: There is a button for Disk Usage. When the... (1 Reply)
Discussion started by: abhilashnair
1 Replies

4. Shell Programming and Scripting

how to generate html file using script?

Hi Friends I have an requirement that i need to generate html file using script. and the script output shold keep adding to that html file like tablewise. can anyone please help me out in this. thanks Krish. (2 Replies)
Discussion started by: kittusri9
2 Replies

5. Web Development

Login page in html on unix

I want to create a login page in HTML which is hosted on apache server. The login page first authenticate the user and then directed to a form which in turn run a script on the server. I want to make login page without php or jsp. Please advice. (13 Replies)
Discussion started by: ravi18s
13 Replies

6. Shell Programming and Scripting

Execute unix command from an html page in windows

i have a problem situation, where i have a html file say click.html. i have a button "ls" in that html page. i run this html file in windows....Now say if i click that "ls" button it must connect to the unix server and execute ls and return the results back to html page in windows. can anyone tell... (8 Replies)
Discussion started by: niteesh_!7
8 Replies

7. Shell Programming and Scripting

Migrating from Shell Script to HTML Page

Hi, Need Help, Recently I have thought to migrating my Korn Shell Scripts to html page..., already webserv is running on my unix machine. How to migrate the shell scripts to html page.. Please refer any web portal or sample codes. Thanks in Adavce (2 Replies)
Discussion started by: l_gshankar24
2 Replies

8. Shell Programming and Scripting

Script To Generate HTML output

Hello All, I need help here with a script. I have a script here which generates a html output with set of commands and is working fine. Now i want to add a new command/function which would run on all the remote blades and output should be included in this html file. Here is the script ... (2 Replies)
Discussion started by: Siddheshk
2 Replies

9. AIX

How to Use a UNIX Shell Script to Create an HTML Web Page?

dear friends , in my work i have to monitor some system performance in hourly basis by runing some commands , for example (lpstat) to know that all the queue is ready how can i create webpage and connect it with the server (AIX operating system) and make this page refreshed every 10 second and... (12 Replies)
Discussion started by: rami abusweilei
12 Replies

10. Shell Programming and Scripting

Script to generate HTML output format listing like orasnap

Hi, Is there any UNIX scripts out there that generates a listing output of some sort similar to OraSnap At the moment, I have a script that I run on multiple servers that has multiple databases and just querying the database sizes of those databases. It generates a text files that contains... (0 Replies)
Discussion started by: newbie_01
0 Replies
CGI::FormBuilder::Template::CGI_SSI(3pm)		User Contributed Perl Documentation		  CGI::FormBuilder::Template::CGI_SSI(3pm)

NAME
CGI::FormBuilder::Template::CGI_SSI - FormBuilder interface to CGI::SSI SYNOPSIS
my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'CGI_SSI', file => "template.html", }, ); DESCRIPTION
This engine adapts FormBuilder to use "CGI::SSI". You can specify any options which "CGI::SSI->new" accepts by using a hashref: my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'CGI::SSI', file => 'form.shtml', sizefmt => 'abbrev' } ); In addition to CGI::SSI new arguments, you can also specify "file", "virtual", or "string" argument. The following methods are provided (usually only used internally): engine Returns a reference to the "CGI::SSI" object prepare Returns a hash of all the fields ready to be rendered. render Uses the prepared hash and expands the template, returning a string of HTML. TEMPLATES
In your template, each of the form fields will correspond directly to a "<!--#echo -->" of the same name prefixed with "field-" in the template. So, if you defined a field called "email", then you would setup a variable called "<!--#echo var="field-email" -->" in your template. In addition, there are a couple special fields: <!--#echo var="js-head" --> - JavaScript to stick in <head> <!--#echo var="form-title" --> - The <title> of the HTML form <!--#echo var="form-start" --> - Opening <form> tag and internal fields <!--#echo var="form-submit" --> - The submit button(s) <!--#echo var="form-reset" --> - The reset button <!--#echo var="form-end" --> - Just the closing </form> tag Let's look at an example "form.html" template we could use: <html> <head> <title>User Information</title> <!--#echo var="js-head" --><!-- this holds the JavaScript code --> </head> <!--#echo var="form-start" --><!-- this holds the initial form tag --> <h3>User Information</h3> Please fill out the following information: <!-- each of these <!--#echo -->'s corresponds to a field --> <p>Your full name: <!--#echo var="field-name" --> <p>Your email address: <!--#echo var="field-email" --> <p>Choose a password: <!--#echo var="field-password" --> <p>Please confirm it: <!--#echo var="field-confirm_password--> <p>Your home zipcode: <!--#echo var="field-zipcode --> <p> <!--#echo var="form-submit" --><!-- this holds the form submit button --> </form><!-- can also use "tmpl_var form-end", same thing --> As you see, you get a "<!--#echo -->" for each for field you define. However, you may want even more control. That is, maybe you want to specify every nitty-gritty detail of your input fields, and just want this module to take care of the statefulness of the values. This is no problem, since this module also provides several other "<tmpl_var>" tags as well: <!--#echo var="value-[field] --> - The value of a given field <!--#echo var="label-[field] --> - The human-readable label <!--#echo var="comment-[field] --> - Any optional comment <!--#echo var="error-[field] --> - Error text if validation fails <!--#echo var="required-[field] --> - See if the field is required This means you could say something like this in your template: <!--#echo var="label-email" -->: <input type="text" name="email" value="<!--#echo var="value-email" -->"> <font size="-1"><i><!--#echo var="error-email" --></i></font> And FormBuilder would take care of the value stickiness for you, while you have control over the specifics of the "<input>" tag. A sample expansion may create HTML like the following: Email: <input type="text" name="email" value="nate@wiger.org"> <font size="-1"><i>You must enter a valid value</i></font> Note, though, that this will only get the first value in the case of a multi-value parameter (for example, a multi-select list). Multiple values (loops) in "CGI_SSI" are not yet implemented. For more information on templates, see HTML::Template. SEE ALSO
CGI::FormBuilder, CGI::FormBuilder::Template, HTML::Template REVISION
$Id: HTML.pm 97 2007-02-06 17:10:39Z nwiger $ AUTHOR
Copyright (c) Nate Wiger <http://nateware.com>. All Rights Reserved. This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. perl v5.14.2 2011-09-16 CGI::FormBuilder::Template::CGI_SSI(3pm)
All times are GMT -4. The time now is 03:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy