Sponsored Content
Top Forums Shell Programming and Scripting Script Shell how's converting .html files Post 303034559 by mariocrocop on Monday 29th of April 2019 01:47:09 PM
Old 04-29-2019
Script Shell how's converting .html files

Hello everybody, Smilie

I need some help with a school project that I have to create for the next week. Smilie

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, they have .css .js files too.

I'm explaining what the script need to do :

1. Copy all inclusions from .shtml files to .html files


In each .html file, there is a comment line like this :
Code:
<!--#include virtual="SSI_include/DeclarationHTML_de.shtml" -->
or
<!--#include virtual="SSI_include/Header.shtml" -->
or
<!--#include virtual="SSI_include/DeclarationHTML.shtml" -->

When a file have a
Code:
#include

I need to copy (by exemple for the first one) the body of the DeclarationHTML_de.shtml in the .html. The body of the DeclarationHTML_de.shtml will replace the comment line !


2. Delete all comments from .html / .css and .js files
Comments for the .html are <!-- blablabla --> They start with <!-- and end with -->
Comments for the .js and .css are like /* blabla */ They start with /* and finish with */

3. Change all files .shtml to .html

4. Create a new folder where I will put all files that I'v changed

5. Verify if the website working (open a .html file in a Firefox page)


I never had before make some Shell script, what I know is that I need to make the workschool in Shell and use Sed (and others basic stuff). Smilie

I need some help for my work and some explainations ! Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting Shell script to Dos batch files

Hi friends! I am having some simple shell script files to build postgresql database and all. Now i want to convert those scripts to dos batch scripts(to run on windows XP/2000/NT) because there is no need of unix emulation for latest release of postgresql. Please somebody help me. (1 Reply)
Discussion started by: darwinkna
1 Replies

2. UNIX for Dummies Questions & Answers

Converting HTML to CSV

Hi, I need to convert a relatively large html file (1.5megs) into CSV under Unix. How would I be able to do this? Much thanks. (3 Replies)
Discussion started by: Jexel
3 Replies

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

4. Shell Programming and Scripting

Converting HTML data into a spreadsheet

Hi, I have a perl script that prints some data in the form of a table (HTML table) Now, I want to be able to convert this data into a report on an Excel sheet. How can I do this? Regards, Garric (4 Replies)
Discussion started by: garric
4 Replies

5. Shell Programming and Scripting

Converting a text file to HTML

Hi, I need to convert a text file formatted like this ("tshark -z conv,ip" output) to HTML: ===================================================================================================== IPv4 Conversations Filter:<No Filter> | <- ... (4 Replies)
Discussion started by: ph0enix
4 Replies

6. Shell Programming and Scripting

Problem in converting number in shell script

Hi All, I am writing a shell script in which I want to convert a number like : Suppose the number is "98487657" and we have to convert it to "98000000", what I want to do is to retain first 2 digits and convert all remaining digits to "0". Number could be of any length (length... (4 Replies)
Discussion started by: amitanshu.verma
4 Replies

7. Shell Programming and Scripting

Converting html to pdf perl

Hi All, I have a requirement of converting an html form into pdf using perl. The html form contains images, tables and css implementation. I tried using various perl modules but failed to achive the target. I succeeded in generating a pdf from the html file using... (2 Replies)
Discussion started by: DILEEP410
2 Replies

8. Shell Programming and Scripting

Converting a shell script to program

Hi I am new in programming. I have written a shell code, but i want to secure my code. I have tried SHC. It is converting it to binary, but can be converted in plain text again by core dump. I have tried to convert it in rpm by "rpmbuild -bb my.spec" option but the result is same. ... (4 Replies)
Discussion started by: Priy
4 Replies

9. Shell Programming and Scripting

Converting csv to html format

Below is the code I have - How can I convert the data in the csv into 3 tables in html. instead of 1 table. Attached is the format I am getting. (1 Reply)
Discussion started by: archana25
1 Replies

10. UNIX for Beginners Questions & Answers

Converting text file to html page

Hello Everyone, I have the following text file with the each field separated by newline Text file P file1-en-us_US-20170718T150157Z.json Wed 19 Jul 2017 06:10:13 AM EDT P file2-en-us_US-20170718T160150Z.json Wed 19 Jul 2017 06:10:13 AM EDT P file3-en-us_US-20170718T163218Z.json Wed... (9 Replies)
Discussion started by: nextStep
9 Replies
DWWW-BUILD(8)							      Debian							     DWWW-BUILD(8)

NAME
dwww-build - build dwww index lists SYNOPSIS
dwww-build [--verbose] --default dwww-build [--verbose] html-directory DESCRIPTION
dwww-build builds the index lists of all available documents (manual pages, Info files, and so on); it should be run whenever documentation is installed or removed. dwww(7) does not work unless dwww-build has been run at least once; when the package is installed, it is run automatically. The default dwww installation creates a /etc/cron.daily/dwww, which automatically updates the pages each day. The html-directory argument specifies the directory where all the dwww HTML files will be stored. No other files should be stored there. If --default is used, the files are generated in dwww subdirectory of the directory specified in the DWWW_DOCROOTDIR variable in the /etc/dwww/dwww.conf file. (Default is /var/www/dwww.) FILES
/etc/dwww/dwww.conf Configuration file for dwww(7). FILES
/etc/dwww/dwww-user.css If such a file exists, its contents will be appended to the dwww.css file. /var/www/dwww Where all dwww HTML files are stored, if nothing else is specified. /var/lib/dwww Directory used for temporary created files. Can be overridden with the DWWW_TMPDIR variable. SEE ALSO
dwww-build-menu(8), dwww(7). AUTHOR
Lars Wirzenius. See dwww(7) for copyrights and stuff. dwww 1.11.1 February 15th, 2009 DWWW-BUILD(8)
All times are GMT -4. The time now is 04:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy