Getting a command not found when comparing in tsch

Hey everyone,

I am almost done with this assignment I have to do but there is one last thing nagging me that I can't seem to find. In my script I am feeding line by line to a ./test file and I am getting the return answer correctly. The goal is to test the current script (check.sh) and if it's output is the same as the testcase.txt file then everything is good. So I have most of the script done but am still getting the "command not found" issue. I'm thinking it's something with my if statement and possibly the comparison. If anyone could point me in the right direct or let me know how to get rid of this error, I would sincerely appreciate it!!! Thank you! Below is my program and then the output it gives.

set dir="$PWD/./test"
set dir2="$PWD/testcase.txt"
set ODD=""
set EVEN=""
set oddlines=`sed -n 1~2p $PWD/testcase.txt > ODD`
set evenlines=`awk NR%2==0 $PWD/testcase.txt > EVEN`
set fodd=$PWD/ODD
set odd="`cat $PWD/ODD`"
set even="`cat $PWD/EVEN`"
set FILERETURN=""
set i=1
set j=1
set counttot=0
set countpass=0

while ($i <= $#odd)
 while ($j <= $#even)
  
  set FILERETURN=(`echo $odd[$i] | $dir`)
     
    #echo $FILERETURN
    #echo $even[$j]
    if $FILERETURN == $even[$j] 
         @ countpass = $countpass + 1
    endif
  #echo $odd[$i]
  
  #echo $even[$j]
   @ counttot = $counttot + 1
   @ i = $i + 1
   @ j = $j + 1
  end
end

echo "passed/total tests" $countpass "/" $counttot
rm ODD EVEN

% check.sh
-1: Command not found.
0: Command not found.
-1: Command not found.
-1: Command not found.
-1: Command not found.
-1: Command not found.
-1: Command not found.
0: Command not found.
passed/total tests 10 / 10

I don't think bumping up posts (see this) will charm the moderators of this forum.