Please use CODE tags for your code. It preserves formatting and makes it much easier to read.
You have two read statements in your while loop. The first read will read line n with the second read getting the contents from line n+1.
You can specify which file descriptor read gets it input from with the u
option. Since you want to read from stdin, whose file descriptor is 1 you'll use:
You can also use the p
option to show a prompt. So you code will be:
while read var1 var2 ; do
if [ "$var3" -eq "$var4" ] ; then
read -p "Press any key to continue" -u 1
done < data.txt
Note also that var3 and var4 are variables and as such must be specified accordingly.
Hope it helps.