Comparing two files for a difference
If you have file1 and file2 and you want to know where they differ, you can use the following if statement.
if ! diff file1 file2 >> /dev/null; then echo "they differ" else echo "they don't differ" fi
[Click to add or edit comments])
Please prepend comments below including a date