> If you're updating both the HTML and the checksum often, you need
something a bit more dynamic, I think, like a CGI script.

>
>
> I don't get it either.  If I update template.html how does that update
> make it
> to output.html other than by running sed?  I'd rather not have to run sed
> to get
> updates out that aren't related to the checksum.
>
> Originally when I asked I thought maybe there's an html tag that
> would take a file name and embed the file's contents into the page,
> but I guess that doesn't exist.
>

HTML itself is just plain text, there aren't any tags that run operations
on the server like including a file's contents into the page.

Depending on where you're hosting you could use CGI, Server Side Includes,
PHP, or any number of other language options to do the job.


If you want to use a shell script, with no template, you could try
something like this:

Step 1: Enclose the md5 sum with <span> tags and an ID you can use to find
it. <span id='progmd5'>705e7980394e597ade51f8ccd2cbfe20 MyProgram.exe</span>

Script option 1 -- inline md5sum:
perl -p -i -e "s|(<span id='progmd5'>).*?(</span>)|\${1}`md5sum
MyProgram.exe`\${2}|" output.html

Script option 2 -- md5sum in variable
PROGRAM_MD5=`md5sum test.html`
perl -p -i -e "s|(<span id='progmd5'>).*?(</span>)|\${1}$PROGRAM_MD5\${2}|"
output.html

The above regex assumes that the start and end span tags are on the same
line.


-- 
http://fridleyfarmer.com -- The Fridley Farmer
http://stuporglue.org -- Web programming, Moore's Ramblings III and other
Miscellaneous Projects
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20120716/88ffb8fa/attachment.html>