3 # If you have the tidied HTML output from two version of 'tidy' then
4 # this can COMPARE the files ONE BY ONE
15 echo "Usage: ./$BN directory1 directory2"
17 echo "$BN: If you have the tidied HTML output from two version of 'tidy' then "
18 echo "$BN: this can COMPARE the html files ONE BY ONE, output to $OUTLOG"
22 if [ -z "$TMPDIR1" ] || [ -z "$TMPDIR2" ] || [ "$TMPDIR1" = "--help" ] || [ "$TMPDIR1" = "-h" ] || [ "$TMPDIR1" = "-?" ]; then
28 if [ ! -d "$TMPDIR1" ]; then
30 echo "$BN: Can NOT locate directory '$TMPDIR1'!"
34 if [ ! -d "$TMPDIR2" ]; then
47 for fil in $TMPDIR1/*.html; do
48 TMPCNT1=`expr $TMPCNT1 + 1`
51 for fil in $TMPDIR2/*.html; do
52 TMPCNT2=`expr $TMPCNT2 + 1`
55 echo "$BN: Found $TMPCNT1 html files in $TMPDIR1"
56 echo "$BN: Found $TMPCNT2 html files in $TMPDIR2"
58 if [ -f "$OUTLOG" ]; then
62 echo "$BN: Found $TMPCNT1 html files in $TMPDIR1" >> $OUTLOG
63 echo "$BN: Found $TMPCNT2 html files in $TMPDIR2" >> $OUTLOG
65 for fil in $TMPDIR1/*.html; do
67 if [ -f "$TMPDIR2/$bfil" ]; then
68 diff -uw $TMPDIR1/$bfil $TMPDIR2/$bfil >> $OUTLOG
69 if [ "$?" = "0" ]; then
70 echo "diff -uw $TMPDIR1/$bfil $TMPDIR2/$bfil are the SAME" >> $OUTLOG
71 SAMECNT=`expr $SAMECNT + 1`
73 DIFFCNT=`expr $DIFFCNT + 1`
76 echo "$BN: File $bfil not found the 2" >> $OUTLOG
79 TOTCNT=`expr $SAMECNT + $DIFFCNT`
80 echo "$BN: Of the $TOTCNT compares made, $SAMECNT are the SAME, $DIFFCNT are DIFFERENT"
81 echo "$BN: Of the $TOTCNT compares made, $SAMECNT are the SAME, $DIFFCNT are DIFFERENT" >> $OUTLOG
83 echo "$BN: Results are in $OUTLOG"