#!/bin/bash
# Check the line number counting of TtH.
# Optionally provide a directory name to run the test on.

for file in $(dir -1 $1*.tex); do
  if [ -e core ]; then
    echo ******************************Core dump!
    rm core;
  fi
 count=`./countlines <$file`
 tthcount=`tth <$file 2>&1 >/dev/null  -L${file%.tex} -p$1 | fgrep Number | awk '{print $6}' -`
 wccount=`wc -l <$file | awk '{print $1}' -`
if [ $count -ne $tthcount ]; then
echo "tth:	$tthcount 	countlines:  $count   	wc:    $wccount	$file"  
fi
done






