If all you want to know is whether the two files differ, cmp is the better tool.
if cmp -s file1 file2; then
echo Files not changed.
fi
If all you want to know is whether the two files differ, cmp is the better tool.
if cmp -s file1 file2; then
echo Files not changed.
fi