我肯定这是个简单的问题,但我想不出来。
我有两份文件:
file1: You are in a maze of twisty little passages, all alike
file2: You are in a maze of twisty little* passages, all alike
我想对这些文件执行sdiff
,但是我想忽略*
字符。
我该怎么做?
发布于 2010-04-07 17:46:57
实际上,-I
会忽略我认为的整行,而不是角色。如果您想忽略该字符,可以:
sdiff <(cat file1 | tr -d '*') <(cat file2 | tr -d '*')
来自man sdiff
的参考:
-I RE --ignore-matching-lines=RE
Ignore changes whose lines all match RE.
https://serverfault.com/questions/130199
复制相似问题