从diff
联机帮助页:
-b, --ignore-space-change
ignore changes in the amount of white space
-w, --ignore-all-space
ignore all white space
据此,我推断-b
和-w
选项之间的差异必须对空白类型(制表符与空格)-b
敏感。但是,情况似乎并非如此:
$ diff 1.txt 2.txt
1,3c1,3
< Four spaces, changed to one tab
< Eight Spaces, changed to two tabs
< Four spaces, changed to two spaces
---
> Four spaces, changed to one tab
> Eight Spaces, changed to two tabs
> Four spaces, changed to two spaces
$ diff -b 1.txt 2.txt
$ diff -w 1.txt 2.txt
$
那么,-b
和-w
选项之间有什么区别?在Kubuntu Linux 13.04上使用diffutils 3.2进行了测试。