How does if statement behave in bash?by Simmons (Login simmons_josh)
This is an example from stack exchange on determining if files are similar or not.
if cmp -s "$file1" "$file2"
echo "The files match"
echo "The files are different"
From what I understand cmp returns 0 if the files are the same and non zero of they are different. So according to that example does bash if statements consider 0 to be true?
Return to Index