the code looks like
"<script type='text/javascript' src='http://benhall.com/firestats/js/fs.js.php?site_id=2'>"
where siteid should be set correctly
modified for sed it looks like
"\<head\>\<script\ type=\'text\/javascript\'\ src=\'http\:\/\/benhall.com\/firestats\/js\/fs.js.php\?site_id=2\'\>\<\/script\>"
so the actual sed command should be similar to:
for file in *.html;do cat $file | sed -e s#\<head\>#\<head\>\<script\ type=\'text\/javascript\'\ src=\'http\:\/\/benhall.com\/firestats\/js\/fs.js.php\?site_id=2\'\>\<\/script\>#g >rewrite/$file;done
simple shell script “firesite.sh”:
#!/bin/bash mkdir rewrite for file in *.html;do cat $file | sed -e s#\<head\>#\<head\>\<script\ type=\'text\/javascript\'\ src=\'http\:\/\/benhall.com\/firestats\/js\/fs.js.php\?site_id=2\'\>\<\/script\>#g >rewrite/$file;done cp rewrite/*.html .