Hello everybody,
I need some help with a school project that I have to create for the next week.
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 :
- 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" -->
or
<!--#include virtual="SSI_include/Header.shtml" -->
or
<!--#include virtual="SSI_include/DeclarationHTML.shtml" -->
When a file have a
#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 !
-
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 */ -
Change all files .shtml to .html
-
Create a new folder where I will put all files that I'v changed
-
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).
I need some help for my work and some explainations !