最佳答案
我如何能够绘制一个 unix diff 命令的结果,而不是一个接一个的差异?下面是一个例子:
diff /tmp/test1 /tmp/test2
1,4c1,2
< asfdsadf
< asdfsad
< fsaf
< fdsadf
---
> asdfsafdsf
> saf
6,8d3
< sadf
< asdf
< sadf
10d4
< fasd
12,13c6,14
< sadfa
< fd
---
> sadf
> sadf
> sadf
> sadf
> sadf
> sadf
> sadf
> sadf
> safa
我想要这样的东西:
diff /tmp/test1 /tmp/test2
1,4c1,2
< asfdsadf > asdfsafdsf
< asdfsad > saf
< fsaf
< fdsadf
---
6,8d3
< sadf
< asdf
< sadf
10d4
< fasd
12,13c6,14
< sadfa > sadf
< fd > sadf
--- > sadf
> sadf
> sadf
> sadf
> sadf
> sadf
> safa