How to suppress all output of diff in shell scripting? How to suppress all output of diff in shell scripting? shell shell

How to suppress all output of diff in shell scripting?


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


diff $FILE1 $FILE2 &>/dev/null