#!/bin/sh
#
# compare all pairs of variables using pair
data=$1
if test ! -s $data
then
	echo $0: "No data file ($data) or empty data file"
	exit 1
fi
shift
ci=1
for i
do
	cj=1
	for j
	do
		if test $ci != $cj
		then
			dm s$ci s$cj < $data |
				pair -ps -x $i -y $j |
				pr -h "Variables $ci ($i) and $cj ($j) in file $data"
		else
			dm s$ci < $data | desc -soh | pr -h "Variable $ci ($i) in file $data"
		fi;
		cj=`echo $cj+1 | bc`
	done
	ci=`echo $ci+1 | bc`
done
