【发布时间】:2010-12-15 20:34:32
【问题描述】:
我想使用 'diff' 来获得两者之间的行差异和字符差异。 例如,考虑:
文件 1
abcde
abc
abcccd
文件 2
abcde
ab
abccc
使用 diff -u 我得到:
@@ -1,3 +1,3 @@
abcde
-abc
-abcccd
\ No newline at end of file
+ab
+abccc
\ No newline at end of file
但是,它只向我展示了这些行的变化。我想看到的是这样的:
@@ -1,3 +1,3 @@
abcde
-ab<ins>c</ins>
-abccc<ins>d</ins>
\ No newline at end of file
+ab
+abccc
\ No newline at end of file
你明白我的意思。
现在,我知道我可以使用other engines 来标记/检查特定行的差异。但我宁愿使用一种工具来完成所有工作。
【问题讨论】:
-
per char diff 在涉及 CJK 文本时特别有用,其中没有空格用于分词。
标签: text command-line diff