set1=$1
set2=$2
setAll=$3

if [ ! -f $set1 ]; then
	echo File $set1 does not exist
	exit
fi
if [ ! -f $set2 ]; then
	echo File $set2 does not exist
	exit
fi
if [ ! -f $setAll ]; then
	echo File $setAll does not exist
	exit
fi

./set $set1 $setAll AB set1.tmp 0
./set $set2 $setAll AB set2.tmp 0
./set set1.tmp set2.tmp AB overlap.tmp 0

o=$(wc -l overlap.tmp | cut -f1 -d' ')
t=$(wc -l $setAll | cut -f1 -d' ')
s1=$(wc -l set1.tmp | cut -f1 -d' ')
s2=$(wc -l set2.tmp | cut -f1 -d' ')

echo -e "$o\t$t\t$s1\t$s2" > hygedata
matlab -nodisplay -r "hygescript;exit" > /dev/null

cat pv

rm *.tmp