xref: /freebsd/contrib/one-true-awk/testdir/Compare.tt (revision d4eeb02986980bf33dd56c41ceb9fc5f180c0d47)
1#!/bin/sh
2
3oldawk=${oldawk-awk}
4awk=${awk-../a.out}
5
6echo compiling time.c
7gcc time.c -o time
8time=./time
9
10echo time command = $time
11
12#case `uname` in
13#SunOS)
14#	time=/usr/bin/time ;;
15#Linux)
16#	time=/usr/bin/time ;;
17#*)
18#	time=time ;;
19#esac
20
21echo oldawk = $oldawk, awk = $awk, time command = $time
22
23
24# an arbitrary collection of input data
25
26cat td.1 td.1 >foo.td
27sed 's/^........................//' td.1 >>foo.td
28pr -m td.1 td.1 td.1 >>foo.td
29pr -2 td.1 >>foo.td
30cat bib >>foo.td
31wc foo.td
32
33td=foo.td
34>footot
35
36for i in $*
37do
38	echo $i "($oldawk vs $awk)":
39	# ind <$i
40	$time $oldawk -f $i $td >foo2 2>foo2t
41	cat foo2t
42	$time $awk -f $i $td >foo1 2>foo1t
43	cat foo1t
44	cmp foo1 foo2
45	echo $i: >>footot
46	cat foo1t foo2t >>footot
47done
48
49ctimes footot
50