- j=`basename $i html`shtml
- sed '-es/<BODY>/<BODY BGCOLOR="#FFFFFF" TEXT="#000000"><TABLE BORDER="0" CELLSPACING="10" CELLPADDING="0"><TR><TD ALIGN="LEFT" VALIGN="TOP" ROWSPAN="2" WIDTH="100" BGCOLOR="#FFFFFF"><!--#config errmsg="No table, contact info@indexdata.dk"--><!--#include virtual="..\/buttonbar.shtml"--><\/TD><TD VALIGN="TOP">/g' '-es/<\/BODY>/<\/TD><\/TR><\/TABLE><\/BODY>/g' '-es/\(HREF=\"yaz.*\)\.html/\1.shtml/g' < $i >$j
+ j=`basename $i html`php
+ awk -v PACKAGE=\"${package}\" 'BEGIN { body = 0 } /<\/BODY/ { body = 0; print "<?php id_footer(); ?>" } { if (body == 1) print $0} /<BODY>/ { body = 1; print "<?php require(\"../id_common.inc\"); id_header(", PACKAGE, "); ?>"; }' < $i | sed "-es/\(HREF=\"${package}.*\)\.html/\1.php/g" >$j