I'm getting some weird behaviour from a for loop that reads each line in a file and after each line, reads every word. Read skips the last word on each line. I think I may have to specify that both whitespace and newline are deliminator but I haven't found out how to do that. Here is the part of the script that matters:
cat $i | while read line
do
echo $line
sleep 1
#Process each word
echo $line | while read -d ' ' word
do
echo $word
sleep 1
done
done