#!/usr/bin/tclsh #use this script to compare the files from the beginning and end of the fill. #or different runs of the script by changing the two directories to compare set vers "" set dir1 "begin$vers" #set dir2 "end" set dir2 "end$vers" set fillList "spinTime.txt$vers" ;#list of fills to split into good and bad set goodList [open ./goodList.txt "w" ] set badList [open ./badList.txt "w" ] puts $goodList " compare files in $dir1/*.v124 to $dir2/*.v124" puts $badList " compare files in $dir1/*.v124 to $dir2/*.v124" #get list of files end seems more reliable than begin #set lookFiles "./$dir1/F*.v124" #why these lines don't work I have no clue #puts "look in -$lookFiles-" #ls says it can't find any files but it #catch { exec ls -l $lookFiles } ret #looks like command is correct catch { exec ls -l ./$dir1 | grep v124 } ret puts "ls out=$ret" set fillFiles [ split $ret "\n" ] foreach line $fillFiles { set i [string first "F" $line ] set j [string length $line] set endFile [string range $line $i $j ] puts "file = $endFile" catch {exec diff "$dir1/$endFile" "$dir2/$endFile" } fileDiff puts "file difference=$fileDiff-" set fill [lindex [split $endFile "."] 0 ] puts "fill=$fill-" catch {exec grep $fill $fillList } fillCheck set errChk [string first "N" $fillCheck ] set errChk2 [string first "x" $fillCheck ] puts "check =$fillCheck ---errCheck=$errChk" #put in bad list if N or x in fill file or if files don't match set good "1" if { $fileDiff != "" } { set good "0" } if { $errChk >= 0 } { set good "0" } if { $errChk2 >= 0 } { set good "0" } if { $good == 1 } { puts $goodList $fillCheck } else { puts $badList $fillCheck} }