#!/bin/bash #usage: checkresults stem # -where stem is the stem of the csv/out filenames to be compared # -stem.csv is generated by the BAD resample script # -stem.out is generated by nntest exec 3<> $1.csv exec 4<> $1.out read checkLine <&3 #skip the first line (table headers) let "pdCount = 0" let "totCount = 0" while read checkLine <&3 do era=${checkLine##*,} #era = substring following last comma let "era /= 150" let "era2 = era + 1" read outLine <&4 testLine=${outLine/$era/"x"} testLine=${testLine/$era2/"x"} #echo $era $era2 "|" $outLine if [ "$outLine" != "$testLine" ] then let "pdCount += 1" fi let "totCount += 1" done echo $pdCount "/" $totCount