problem to count number of words from file

hi every one i have written this simple shell for counting number of word that user need to find from file
but i have get several error when run it. can someone tell me the problem ?

echo "Enter the file name"
read file
echo "enter word"
read word
for i in \`cat $file`
do
if [ $i == $word ]
then
count=\`expr $count + 1`
fi
done
echo "number of words: $count"

if this is not homework, use grep instead (see cleaned up code) ... if homework, here is a hint: stream the words with sed and then count the occurences --

echo "Enter the file name"
read file
echo "enter word"
read word
count=$(grep -c -w "$word" $file)
echo "number of words: $count"