在diff -urN中抑制日期

时间:2016-07-10 11:47:09

标签: diff

我正在使用diff -urN来比较两个目录并创建一个补丁,例如:

diff -urN ../resources-original/ogc ogc > ../../../src/main/patches/ogc.patch

该修补程序包含---+++行中的日期:

--- ../resources-original/ogc/wms/1.3.0/capabilities_1_3_0.xsd  Sun Jul 22 03:59:38 2012
+++ ogc/wms/1.3.0/capabilities_1_3_0.xsd    Sun Jun 12 19:59:29 2016

是否有可能取消这些日期?

1 个答案:

答案 0 :(得分:1)

也许像

awk '/^(---|\+\+\+)/ { sub("  " $(NF-5) " " $(NF-4) " " $(NF-3) " " $(NF-2) " "$(NF-1) " " $NF, "  Thu Jan 1 00:00:00 1970") }1'