Sponsored Content
Full Discussion: Output as a html file
Top Forums UNIX for Dummies Questions & Answers Output as a html file Post 302741467 by Yoda on Sunday 9th of December 2012 01:36:48 AM
Old 12-09-2012
Before appending text file to html file make sure you close the table tag:-
Code:
{
 echo "</td></tr></table>"
 echo "<p>failed:</p>"
 echo "<p>"
 cat HC_Report.txt
 echo "</p>"
} >> color.html

---------- Post updated at 00:36 ---------- Previous update was at 00:20 ----------

Or remove the following table closing tag from if else construct and put it outside the condition, because the table has to be closed anyway:-
Code:
else
     echo "<tr>"
     echo "<td>SRB</td>"
     echo "<td style="background-color:Red"> RED </td>"
     echo "</tr>"
     echo "</table>"
fi


Last edited by Yoda; 12-09-2012 at 02:30 AM..
This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

formatting output in html

hello all. I was hoping someone may have an idea or two. I'm throwing together a shell script that does a lot of application and system level data collection. The idea is is you run it before/after restarting an application for later analysis. A lot of stuff is collected... resource stats,... (4 Replies)
Discussion started by: ebbtide
4 Replies

2. UNIX for Dummies Questions & Answers

How do I extract text only from html file without HTML tag

I have a html file called myfile. If I simply put "cat myfile.html" in UNIX, it shows all the html tags like <a href=r/26><img src="http://www>. But I want to extract only text part. Same problem happens in "type" command in MS-DOS. I know you can do it by opening it in Internet Explorer,... (4 Replies)
Discussion started by: los111
4 Replies

3. Shell Programming and Scripting

awk script to search an html file and output links

hello. i want to make an awk script to search an html file and output all the links (e.g .html, .htm, .jpg, .doc, .pdf, etc..) inside it. also, i want the links that will be output to be split into 3 groups (separated by an empty line), the first group with links to other webpages (.html .htm etc),... (8 Replies)
Discussion started by: kyris
8 Replies

4. Shell Programming and Scripting

how to display the output file in an html format using perl

Hi, I have written a perl script to dispaly some statements from a file but i want the output statements to be dispalyed in an HTML format.Is it possible for me to do in perl scripting? Please help me with ur thoughts. Thanks In Advance Meva. (1 Reply)
Discussion started by: meva
1 Replies

5. Shell Programming and Scripting

Convert shell script output txt file to html table

Hi, I have script which generates the output as below: Jobname Date Time Status abc 12/9/11 17:00 Completed xyz 13/9/11 21:00 Running I have the output as a text file. I need to convert it into a HTML Table and sent it thru email ... (6 Replies)
Discussion started by: a12ka4
6 Replies

6. Shell Programming and Scripting

Removing all except couple of html tags from html file

I tried to find elegant (or at least simple) way to remove all but couple of html tags from html file, but all examples I found dealt with removing all the tags. The logic of the script would be: - if there is <li> or <ul> on the line, do nothing (=write same line to output) - if there is:... (0 Replies)
Discussion started by: juubuntu
0 Replies

7. Shell Programming and Scripting

Need to convert output.txt into html file

I have output.txt file generated through shell scripts which need convert in tabular format using html can you please help me output.txt Token State Date1 Date2 Description Name 34567 open 27/06/13 28/06/13 ... (5 Replies)
Discussion started by: vijay_rajni
5 Replies

8. UNIX for Dummies Questions & Answers

Help with redirecting output to an HTML file

I'm very new to shell scripting and am practicing how to write a script, then redirect the output into an HTML file, and then email both the script and the HTML file to myself. I have created a script called sysinfo_page, and thought it would have redirected the output into the sysinfo_page.html... (3 Replies)
Discussion started by: braing
3 Replies

9. Homework & Coursework Questions

Help with redirecting output to an HTML file

1. The problem statement, all variables and given/known data: I'm having trouble redirecting the output of my sysinfo_page script into my sysinfo_page.html file. The task at hand is to be able to email both the html file and the script to myself. I'm assuming that the html should appear as a web... (8 Replies)
Discussion started by: braing
8 Replies

10. Shell Programming and Scripting

Convert shell script output txt file to html table

My concnern related to the post -Convert shell script output txt file to html table, in this how to print the heading as color. awk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' <filename> (8 Replies)
Discussion started by: sarajobmai
8 Replies
HTML::AsSubs(3) 					User Contributed Perl Documentation					   HTML::AsSubs(3)

NAME
HTML::AsSubs - functions that construct a HTML syntax tree SYNOPSIS
use HTML::AsSubs; $h = body( h1("This is the heading"), p("This is the first paragraph which contains a ", a({href=>'link.html'}, "link"), " and an ", img({src=>'img.gif', alt=>'image'}), "." ), ); print $h->as_HTML; DESCRIPTION
This module exports functions that can be used to construct various HTML elements. The functions are named after the tags of the correponding HTML element and are all written in lower case. If the first argument is a hash reference then it will be used to initialize the attributes of this element. The remaining arguments are regarded as content. For a similar idea (i.e., it's another case where the syntax tree of the Perl source mirrors the syntax tree of the HTML produced), see HTML::Element's "new_from_lol" method. For what I now think is a cleaner implementation of this same idea, see the excellent module "XML::Generator", which is what I suggest for actual real-life use. (I suggest this over "HTML::AsSubs" and over "CGI.pm"'s HTML-making functions.) ACKNOWLEDGEMENT
This module was inspired by the following message: Date: Tue, 4 Oct 1994 16:11:30 +0100 Subject: Wow! I have a large lightbulb above my head! Take a moment to consider these lines: %OVERLOAD=( '""' => sub { join("", @{$_[0]}) } ); sub html { my($type)=shift; bless ["<$type>", @_, "</$type>"]; } :-) I *love* Perl 5! Thankyou Larry and Ilya. Regards, Tim Bunce. p.s. If you didn't get it, think about recursive data types: html(html()) p.p.s. I'll turn this into a much more practical example in a day or two. p.p.p.s. It's a pity that overloads are not inherited. Is this a bug? BUGS
The exported link() function overrides the builtin link() function. The exported tr() function must be called using &tr(...) syntax because it clashes with the builtin tr/../../ operator. SEE ALSO
HTML::Element, XML::Generator Private Functions _elem() The _elem() function is wrapped by all the html 'tag' functions. It takes a tag-name, optional hashref of attributes and a list of content as parameters. perl v5.12.1 2006-08-04 HTML::AsSubs(3)
All times are GMT -4. The time now is 01:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy