找到两个文件之间的差异(Finding the differences between two files)
我有几个包列表,有数百个条目,我想找到它们的不同之处。
文件的内容看起来像
档案1:
somepackage1 0.1 somepackage2 5.6 somepackage3 1.3-1 etc...
文件2:
somepackage1 0.1 somepackage2 5.7 somepackage3 1.3-1 somepackage4 0.1 etc...
我正在寻找几个命令或脚本,可以生成所有添加的新包。 不只是版本号,而是添加了新包。
因此,例如,在给定上述两个文件的情况下,命令或脚本将输出
somepackage4
。我一直在玩一些命令,但无法让它们正常工作。 有没有人有这样做的好方法?
I have a couple of packages lists, with hundreds of entries, and I would like to find the differences of them.
The contents of the files look like
File 1:
somepackage1 0.1 somepackage2 5.6 somepackage3 1.3-1 etc...
File 2:
somepackage1 0.1 somepackage2 5.7 somepackage3 1.3-1 somepackage4 0.1 etc...
I'm looking for a couple of commands or a script that can produce all the new packages that were added. Not just the version numbers, but if a new package was added.
So, for example the command or script would output
somepackage4
given the above two files.I've been playing with some commands, but can't get any of them work properly. Does anyone have a good way of doing this?
原文:https://stackoverflow.com/questions/21106583