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