3 # $eterna: html_cmp,v 1.8 2003/02/06 09:40:39 mrg Exp $
5 # like cmp(1) but compares to files after making their `Date: ' headers
6 # the same, to allow `now' and `then' to work properly. it also tries
7 # to find servername's that might be the local host and converts those
10 # it must be called like `cmp file1 file1' *only*.
12 h
=`hostname || uname -n`
14 sedcmd
="s/^Date: .*/Date: nowish/;
15 s/^Last-Modified: .*/Last-Modified: nowish/;
16 s/[a-zA-Z0-9-]*\.eterna\.com\.au/$h/g;
17 s/^Server: .*/^Server: bozotic HTTP server version 5.08/;
18 s/^Content-Length: .*/Content-Length: 223/;"
20 sed -e "$sedcmd" < $1 > f1.tmp.$$
21 sed -e "$sedcmd" < $2 > f2.tmp.$$
23 cmp -s f1.tmp.$$ f2.tmp.$$
25 rm -f f1.tmp.$$ f2.tmp.$$