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
App::Prove::Plugin::HTML(3pm)				User Contributed Perl Documentation			     App::Prove::Plugin::HTML(3pm)

NAME
App::Prove::Plugin::HTML - a prove plugin for HTML output SYNOPSIS
# command-line usage: prove -P HTML=outfile:out.html,css_uri:style.css,js_uri:foo.js,force_inline_css:0 # NOTE: this is currently in alpha, this usage will likely change! DESCRIPTION
This is a quick & dirty second attempt at making TAP::Formatter::HTML easier to use from the command line. It will change once App::Prove has better support for plugins than need to take cmdline data. The original goal was to be able to specify all the args on the cmdline, ala: prove --html=output.html --css-uri foo.css --css-uri bar.css --force-inline-css 0 But this is currently not possible with the way the App::Prove plugin system works. As a compromise, you must use the following syntax: prove -P HTML=arg1:val1,arg2:val2,... Where argN is any TAP::Formatter::HTML parameter that is configurable via %ENV. Example prove -P HTML=outfile:out.html,css_uri:style.css,js_uri:foo.js,force_inline_css:0 This will cause prove to load this plugin, which loads TAP::Formatter::HTML for you, and sets formatter to "TAP::Formatter::HTML" to save you some typing. To configure TAP::Formatter::HTML, the following %ENV vars are set: TAP_FORMATTER_HTML_OUTFILE=out.html TAP_FORMATTER_HTML_FORCE_INLINE_CSS=0 TAP_FORMATTER_HTML_CSS_URIS=style.css TAP_FORMATTER_HTML_JS_URIS=func.js Yes, you can pass 2 or more css_uri or js_uri args. %ENV vars?! Briefly, App::Prove currently only lets you specify the "formatter_class" for TAP::Harness, it doesn't let you instantiate a formatter, or pass config to the formatter. Yes, I know %ENV vars are a horrible way to do things. If it bugs you too, then join the TAP::Harness devs and help us fix it ;-). BUGS
Please use http://rt.cpan.org to report any issues. AUTHOR
Steve Purkis <spurkis@cpan.org> COPYRIGHT
Copyright (c) 2008-2010 Steve Purkis <spurkis@cpan.org>, S Purkis Consulting Ltd. All rights reserved. This module is released under the same terms as Perl itself. SEE ALSO
prove, App::Prove, TAP::Formatter::HTML perl v5.12.4 2011-11-09 App::Prove::Plugin::HTML(3pm)
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy