man bash : Command substitution allows the output of a command to replace the command name, i.e will make the command's stdout available for e.g. variable assignment. cmp will not output anything if files are identical, or some explanatory text if not; neither of which you want to (or can) test for. You'd go for the exit code instead. Try
if cmp $e1 $e2 && [ "$e1" != "$e2" ]; then echo same; else echo diff; fi
Trying to assign the entry variables like you showed in post#1 will fail as the while loop reading from a pipe is executed in a subshell that can't return it's variables to the parent shell, resulting in entry1 and entry2 not being set in the parent shell. Try "process substitution" for the ls command, or put ls 's output into a file and read the variables from there.