
# Look at a bunch of bargraph files and figure out the max amongst them all.
# Usage: getmax file file file....
#
# Hacked into existence by Larry McVoy (lm@sun.com now lm@sgi.com).
# Copyright (c) 1994 Larry McVoy.  GPLed software.
# $Id: getmax,v 1.1 1994/11/23 07:16:48 lm Exp $
eval "exec perl -Ss $0 $*"
	if 0;

$max = -1000000000;
foreach $file (@ARGV) {
	open(FD, $file);
	while (<FD>) {
		next if /^%/;
		split;
		$max = $_[0] if ($_[0] > $max);
	}
	close(FD);
}
foreach $file (@ARGV) {
	open(FD, $file);
	@lines = <FD>;
	open(FD, ">$file");
	print FD @lines;
	print FD "%fakemax $max\n";
	close(FD);
}
