If Exit status: 0 is true, everything else is false exit n command in shell if cmp file1.txt file2.txt; then echo "files same" elif diff -i file1.txt file2.txt; then echo "files same except case" else echo "files different" fi