Sponsored Content
Top Forums Shell Programming and Scripting how to generate html file using script? Post 302199094 by kpearson on Sunday 25th of May 2008 11:38:21 PM
Old 05-26-2008
Agreed. I use bash scripts for my cgi and output plenty of data, building HTML on the fly.

For example, I have a help topics page for my wife that is entirely scripts. I add a small text file, and the script formats it and puts it on the webpage in alphabetical order.

I.e:

Clothing_And_Shoes

would be the name of the text file, and inside would be some simple information.

Here's a copy of a script named ShowHelp.cgi that would be called from index.shtml (SSI must be enabled) and would output the text files:

Code:
#!/bin/sh
cnt=0
printf 'content-type: text/html\n\n'
LST=`ls|grep -v cgi|grep -v html`
for i in $LST
 do
  cnt=$(($cnt+1))
  LNK=$i
  NM=`echo $i|tr '_' ' '`
  printf "<tr><td align=justify bgcolor=white><center><a name=$LNK>Note $cnt:<b>&nbsp;&nbsp;$NM</b></center><br>"
  printf '<table border=0 align=center cellpadding=0 cellspacing=0 bgcolor=white><tr><td align=justify>'
  cat $i
  printf "<p align=center><a href=#TOP>Top of Page</a></p>"
  printf "</td></tr></table>"
  printf "</td></tr>"
done

Hopefully that will help, but as scarfake said, without some information of what precisely you need, we're just guessing.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Generate report in HTML file from Oracle DB

Hi Team, I need a suggestion/comments for my below requirement. I have a procedure which performs some DDL operations & loads data into a Oracle table. This status contains Audit data. What i wanted to do is, once the procedure is completed (daily), shell script should retrive the data from the... (4 Replies)
Discussion started by: Amit.Sagpariya
4 Replies

2. Shell Programming and Scripting

KSH - help needed for creating a script to generate xml file from text file

Dear Members, I have a table in Oracle DB and one of its column name is INFO which has data in text format which we need to fetch in a script and create an xml file of a new table from the input. The contents of a single cell of INFO column is like: Area:app - aam Clean Up Criteria:... (0 Replies)
Discussion started by: Yoodit
0 Replies

3. Shell Programming and Scripting

Script to generate csv file

Hello; I need to generate a csv file that contains a list of all the files in a particular server (from the root directory ie: \) that have a permission stamp of 777. I would like to create the csv so that it contains the following: server name, file name, full path name where file exists,... (17 Replies)
Discussion started by: gvolpini
17 Replies

4. UNIX for Dummies Questions & Answers

How to generate html reports through LINUX Scripting?

Hi All, I am trying to generate a weekly HTML report using LINUX Scripting. This will have record counts of some files. (like below) touch path/filename.html echo "Weekly Summary Report for Business Date : $P_BUS_DT">path/filename.html export A1=`cat path/filename1.txt |wc -l` echo "A1... (6 Replies)
Discussion started by: dsfreddie
6 Replies

5. 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

6. Shell Programming and Scripting

Needed script to FTP a File and generate a quality checksum file

hi all i want a script to FTP a file and should generate a quality checksum file means when I FTP a file from one server to another server it should generate a QC file which should contain timestamp,no.of records in that file Thanks in advance saikumar (3 Replies)
Discussion started by: hemanthsaikumar
3 Replies

7. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: HHarsh
2 Replies

8. UNIX for Dummies Questions & Answers

Need script to generate file.

Hi I have a file "test" with data as below 1,APRIL,NEW,"New market,delhi,pune,India",RECENT, 254664 2,MARCH,OLD,"New Area,Mumbai,UP,India",CURRENT, 152483 So I want a script which provides output as below 1,APRIL,RECENT,254664 2,MARCH,CURRENT,152483 I am aware we can use awk/sed... (9 Replies)
Discussion started by: sv0081493
9 Replies

9. 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

10. Shell Programming and Scripting

Script to generate csv file

Dears, I am new in shell world and I need your help in this, I have to create a report based on the output file generated by another program. I want to write a shell script for this. The output file generated every 15 minutes but i can’t open it until the end of day so the script will get the... (3 Replies)
Discussion started by: abdul2020
3 Replies
TTHSPLIT(1)						      General Commands Manual						       TTHSPLIT(1)

NAME
tthsplit - TtH gold HTML file splitting utilities SYNOPSIS
tthprep filename.tex tthsplit <filename{.html,.xml} ttmsplit <filename{.html,.xml} tthrfcat DESCRIPTION
The script tthprep runs LaTeX to generate the auxiliary files that tth or ttm need to properly link respectively an HTML or XML web docu- ment. The programs tth or ttm for converting TeX or LaTeX documents to HTML or XML respectively have a -s option which cause them to generate a single output file split into sections or chapters with fixed names. The program tthsplit splits the single file into files with fixed names depending on the LaTeX source. Each document should have its own directory to avoid overwriting each others files. Program ttmsplit is just a symlink to tthsplit. For complex documents with multiple bibliographies the tth and ttm programs generate references to a single file refs.html or refs.xml respectively. The tthrfcat program concatenates multiple bibliography files into such a single file and then deletes the multiple files. EXAMPLE
$ tthprep sample2e.tex $ tth -s sample2e.tex $ tthsplit <sample2e.html index.html sec1.html sec2.html footnote.html $ produces the four cross linked HTML files listed from a copy of the example file sample2e.tex distributed with LaTeX 2e and present on Debian systems with LaTeX installed. SEE ALSO
tth(1), ttm(1). The programs are documented fully in /usr/share/doc/tth-common/html/gold_man.html. AUTHOR
TtHgold was written by Ian Hutchinson <tth@hutchinson.belmont.ma.us>. This manual page was written by Ian Maclaine-cross <iml@debian.org>, for the Debian project (and may be used by others). February 7, 2011 TTHSPLIT(1)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy