在diff手册页上,我找到了这些退出值:
0 No differences were found. 1 Differences were found. >1 An error occurred.
对于不同的错误,是否有不同的出口值高于1?
这取决于你的diff命令。 Mine(GNU diffutils 3.0)说:
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.