Script Shell how's converting .html files

Login or Register to Reply

Thread Tools Search this Thread
# 1  
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 :
<!--#include virtual="SSI_include/DeclarationHTML_de.shtml" -->
<!--#include virtual="SSI_include/Header.shtml" -->
<!--#include virtual="SSI_include/DeclarationHTML.shtml" -->

When a file have a

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
# 2  
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

Thread is closed now, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
This User Gave Thanks to vbe For This Post:
Login or Register to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
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...... Shell Programming and Scripting
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... Shell Programming and Scripting
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... Shell Programming and Scripting
Shell Programming and Scripting
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.... UNIX for Dummies Questions & Answers
UNIX for Dummies Questions & Answers
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.... Shell Programming and Scripting
Shell Programming and Scripting
Linux and UNIX

Linux is a family of open source Unix-like operating systems based on the Linux kernel. The Linux kernel is an operating system kernel first released by Linus Torvalds on 17 September 1991. Linux distributions include the Linux kernel, system software and libraries. Popular free open source Linux distributions include Debian, Fedora, and Ubuntu. Commercial Linux distributions include Red Hat Enterprise Linux and SUSE Linux Enterprise Server. Linux may be freely modified and redistributed. Anyone on the planet may create a Linux distribution for any purpose.
Unix (trademarked as the UNIX certification mark) is a very mature family of multitasking, multiuser computer operating systems that evolved from the original AT&T Unix. Unix development starting in the 1970s by legendary Bell Labs programmers Ken Thompson, Dennis Ritchie, and others. Unix was first targeted for the Bell System and AT&T licensed Unix to outside parties. In the 1970s time period, this lead to a variety of for-profit as well as not-for-profit Unix variants.
In the early days, this included the University of California, Berkeley (BSD), Microsoft (Xenix), IBM (AIX), and Sun Microsystems (Solaris). In the early 1990s, AT&T sold their Unix rights to Novell. In 1995 Novell sold their Unix business to the Santa Cruz Operation (SCO). The UNIX trademark was passed to The Open Group, a "neutral" industry consortium. The Open Group promoted the use of the UNIX trademark for certified operating systems that comply with the Single UNIX Specification (SUS). In 2014 Apple's macOS became the Unix version with the largest global install base and macOS remains the largest Unix-user base today.
Please enjoy and help our forum community by "showing your work" and posting your code, even when your code is not working as expected. To help others help you, please wrap your code blocks, sample input, sample output, error messages, and other data in CODE tags and wrap your short commands and short data objects in ICODE tags. We were all beginners in the beginning. If you have any questions about how to register or how to post, please contact us in Live Chat. Thank you and enjoy this "forever free" technical support community for UNIX, Linux and computer information technology in general.