etc/services - sync with NetBSD-8
[minix.git] / libexec / httpd / testsuite / html_cmp
blob15931b0177d5d6e98e9d35a3d18b944e0ccdfe94
1 #! /bin/sh
3 # $eterna: html_cmp,v 1.9 2011/11/17 22:18:02 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
8 # as well..
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.$$"
24 rv=$?
25 rm -f "f1.tmp.$$" "f2.tmp.$$"
27 exit $rv