OP said nothing of CGI... That is your own constraint. 
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Yaron <tclug at freakzilla.com> wrote:

SED can't be a CGI script though. And like I said, this is simplifying. My 
CGI scripts usually do a bunch more, but I typed up the part that's 
relevant.

On Sat, 14 Jul 2012, Eric Crist wrote:

> Using perl for THIS is silly. sed can do everything you'er doing with perl.
>
> -----
> Eric F Crist
>
>
>
> On Jul 14, 2012, at 22:03:01, Yaron wrote:
>
>> I use perl GCI for this kind of stuff all the time. Basically make your html file (lets call it file.html) and put a marker in there, like %%MD5SUM%% or something. Then your CGI does this:
>>
>> 	#!/usr/bin/perl
>> 	$|=1;
>> 	$file="file.html";
>> 	chomp($md5=`md5sum direct.tar.bz2`);
>>
>> 	open(F, $file);
>> 	while(<F>) {
>> 		s/%%MD5SUM%%/$md5/ if (/%%MD5SUM%%/);
>> 		print;
>> 	}
>>
>> 	close (F);
>> 	exit(0);
>>
>> That's extremely simplified with no full paths or strict mode or error checking, but you get the idea.
>>
>> On Sat, 14 Jul 2012, Brian Wood wrote:
>>
>>> I'm wondering how to automate something further. Currently I
>>> use the following commands (in a script) when I publish a
>>> new version of the software.
>>> md5sum direct.tar.bz2 | tee md5checksum
>>> cat md5checksum | xclip -sel clip
>>> After that I edit an html file by hand and paste the new
>>> checksum into the file. Once in a while I forget to do that
>>> step. So I'd like to figure out how to improve the process.
>>> What do you suggest? Thanks in advance.
>>> Shalom,
>>> Brian Wood
>>> Ebenezer Enterprises
>>> http://webEbenezer.net
>>>
>>
>>
>> -Yaron
>>
>>_____________________________________________

>> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
>> tclug-list at mn-linux.org
>> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
>


-Yaron

--
_____________________________________________

TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list at mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20120714/17dc5a37/attachment-0001.html>