On the diff
man-page I've found these exit values:
0 No differences were found.
1 Differences were found.
>1 An error occurred.
Are there different exit values above 1 for different errors?
It depends on your diff
command. Mine (GNU diffutils 3.0) says:
An exit status of
0
means no differences were found,1
means some differences were found, and2
means trouble. Normally, differing binary files count as trouble, but this can be altered by using the-a
or--text
option, or the-q
or--brief
option.