SHELL SCRIPT AND HTML


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SHELL SCRIPT AND HTML
# 1  
Old 07-20-2010
SHELL SCRIPT AND HTML

Hello
I'm trying to develop a shell script that executes commands such as cat / etc / fstab uname, etc. ..... which generates me an output file format html own way.
Currently the shell script with the commands there, I have some notions of html but the generation of my html file is not clean at all in terms of layout.
I give you an example of script
Code:
# / Bin / bash
echo <HTML>>> file.html
echo <BODY>>> file.html
echo <BR> SYSTEM </ BR>>> file.html
cat / etc / fstab>> file.html
echo <BR> USERS </ BR>>> file.html
cat / etc / passwd>> file.html
echo </ BODY>>> file.html
echo </ HTML>>> file.html

thank you very much for your help

Last edited by pludi; 07-20-2010 at 07:44 AM.. Reason: code tags, please...
# 2  
Old 07-20-2010
try this

Code:
# /Bin/bash
echo "<HTML>"> file.html                      # new file every time
echo "<BODY>">> file.html
echo "<BR> SYSTEM </ BR>">> file.html
echo "<PRE>">> file.html                       #keep spaces and new line
cat /etc/fstab>> file.html
echo "</ PRE>">> file.html
echo "<BR> USERS </ BR>">> file.html
echo "<PRE>">> file.html
cat /etc/passwd>> file.html
echo "</ PRE>">> file.html
echo "</ BODY>">> file.html
echo "</ HTML>">> file.html

# 3  
Old 07-20-2010
Quote:
Originally Posted by Lusen
try this

Code:
# /Bin/bash
echo "<HTML>"> file.html                      # new file every time
echo "<BODY>">> file.html
echo "<BR> SYSTEM </ BR>">> file.html
echo "<PRE>">> file.html                       #keep spaces and new line
cat /etc/fstab>> file.html
echo "</ PRE>">> file.html
echo "<BR> USERS </ BR>">> file.html
echo "<PRE>">> file.html
cat /etc/passwd>> file.html
echo "</ PRE>">> file.html
echo "</ BODY>">> file.html
echo "</ HTML>">> file.html

thanks a lot
I don't know <PRE>
and you are very fast
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script Shell how's converting .html files

Hello everybody, :) I need some help with a school project that I have to create for the next week. :eek: So first, the aim of the Script is that I have a WebSite with a lot of .html / .shtml / .js / .css in one directory. That directory have few directory too but that's not so important,... (1 Reply)
Discussion started by: mariocrocop
1 Replies

2. Shell Programming and Scripting

Using HTML inside shell script

Hi, Am trying to use HTML tags inside my script but its not printing the required output. Any idea how to use html inside script will be helpful. #!/bin/ksh echo '<html>' echo '<font face='Calibri' size='3'> JobName Status</font>' echo '</html>' Output<html> <font ... (6 Replies)
Discussion started by: rogerben
6 Replies

3. Shell Programming and Scripting

Help in using html in Shell script

Hi, I made a script that displays various fileds of report that are required in csv format and send it on mail(the csv file). Now I want to convert the csv format into html table and then send it on mail. Reports_Output.csv Code:... (6 Replies)
Discussion started by: Supriya Singh
6 Replies

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

5. Shell Programming and Scripting

Return to HTML file from shell script

Hi! I'm writing a simple script which I call on using a simple html button. The script also recives a simple argument. After the script is done I immediately want to return to my html page. But I dont know how to do that! #!/bin/sh echo "Content-type: text/html" echo "" if then echo... (1 Reply)
Discussion started by: crille
1 Replies

6. Shell Programming and Scripting

How can I execute a shell script from an html link?

I want to execute a shell script when clicking on an html link. I want the output of the script to be shown on the webpage. Whats the best way to achieve this? (6 Replies)
Discussion started by: streetfighter2
6 Replies

7. UNIX for Advanced & Expert Users

shell script to parse html file

hi all, i have a html file something similar to this. <tr class="evenrow"> <td class="data">added</td><td class="data">xyz@abc.com</td> <td class="data">filename.sql</td><td class="modifications-data">08/25/2009 07:58:40</td><td class="data">Added TK prof script</td> </tr> <tr... (1 Reply)
Discussion started by: sais
1 Replies

8. Shell Programming and Scripting

have a shell script done in pl/sql and want output in html

I have this shell script where I have both pl/sql and sql. But want to have a snigle output file where the result of each cursors are in HTML tables. I was able to do that on my old script but it was only sql scripts (no pl/sql). Can I do have such outputs now with my new script where I... (2 Replies)
Discussion started by: arobert
2 Replies

9. UNIX for Dummies Questions & Answers

Unix Shell Script along with .HTML

Hi, I need to know how to interact the unix shell script along with a .html. For example, I have a code like: #! /bin/sh exit_err() { print "Content-type: text/html\n" print $1 exit } toolbin/gu -i -r 'm_who(user,group,role,name,addr,phone)' > /tmp/temp.txt... (3 Replies)
Discussion started by: ronix007
3 Replies

10. Shell Programming and Scripting

Converting Shell Script to HTML

Hi, Im new to shell scripting. My task is to convert shell script feed into html, so basically I have a lot of information in shell script and I want to convert it html. I know you can simply convert the information by hand, but is there any simpler way? Thank you Dave (3 Replies)
Discussion started by: davwel
3 Replies
Login or Register to Ask a Question