diff

Shell script to compare directories recursively

≯℡__Kan透↙ 提交于 2019-12-22 10:20:16
问题 I have a file server backup on an external hard drive a few months old for a file server that went down since then. Most of the data was recovered onto a temporary file server thats been in use since then but there are some inconsistencies. I am going to mount the external and rsync it with the current data to it but first I need to establish files that have gotten updated on the newer copy. I can do diff -r -q /old/ /new/ to obtain this, I am trying to get better at scripting so I am trying

Comparison of bmp files?

梦想与她 提交于 2019-12-22 09:25:00
问题 I want to compare two bmp files. I thought of two approaches: to compare the header as well as the information header of the two files convert the bmp file to binary and then do the above comparison But, I don't know how to start and which will be a better approach. I would be glad if someone could please help me! 回答1: I don't know on which platform you want to implement this, but here are some code snippets which could be useful: Compare two images with C# This is a snippet to compare 2

Is there any formal way or known way to canonicalize an xml file to generate diffs?

你离开我真会死。 提交于 2019-12-22 08:53:10
问题 There seems to be many questions WRT tool to generate diffs between xmls, but there wasn't this question yet, so anyone who knows this show me a link or paste any example anyone already solved this problem. Canonicalizing an xml file means, reordering the appearance of attributes reordering the appearance of tags (selectable by command line option) insert line ending(CR/CR+LF/LF) if there isn't at the end of a close tag insert indentation tab(space) remove redundant spaces and line endings

Split a file with conflict markers

倖福魔咒の 提交于 2019-12-22 05:23:07
问题 I am looking for a tool that will split a file that has conflict markers into the two separate files. Is there anything out there that does this already? 回答1: xxdiff can do that: xxdiff --unmerge myfile.txt it also works if the conflict markers result from a 3-way diff xxdiff --unmerge3 myfile.txt 回答2: The tool I work for (ECMerge) does that, primarily with the target of helping you to merge them visually of course. You could as well save the left/right/ancestor files with the built-in

Compare two different urls using Linux

你。 提交于 2019-12-22 04:44:16
问题 Am I able to compare two different urls/websites without downloading the file first using wget or something similar first. I tried the following, but received the below error. [root@desktop ~]# diff http://www.example.net/index.php http://www.example.com/index.php diff: http://www.example.net/index.php: No such file or directory diff: http://www.example.com/index.php: No such file or directory [root@desktop ~]# 回答1: Of course you can use curl , although it is a bit strange: diff <(curl url1)

How to ignore lines starting with a string with diff?

淺唱寂寞╮ 提交于 2019-12-22 03:48:29
问题 How can I diff two files and ignore lines starting with a sequence. E.g File1: abc def time:123 File2: igh def time:345 With unix diff it will report <time:123 >time:345 I want to ignore this diff. Any ideas? 回答1: How about: diff -I '^time.*' file1 file2 ? Please not it doesn't always work as expected as per diffutils manual: However, -I only ignores the insertion or deletion of lines that contain the regular expression if every changed line in the hunk (every insertion and every deletion)

How to default to side-by-side view in GitLab

杀马特。学长 韩版系。学妹 提交于 2019-12-22 01:54:01
问题 How can I make Side-by-side be the default diff for my GitLab installation or project or profile? 回答1: Update February 2016 The issue is now at issue CE 3071 and... was resolved by commit 9fdd605! A cookie now retain your diff view choice, with GitLab 8.5.0+. Original answer (February 2015) That doesn't seem to be possible right now, and can be voted up at the suggestion 7082397 Remember side-by-side diff choice Right now when I want to review code, I have to choose side-by-side diff each

How to store result of diff in Linux

江枫思渺然 提交于 2019-12-22 01:28:42
问题 How to get the result on another file after applying diff to file A.txt and B.txt. Suppose File A.txt has: a b c File B.txt has: a b on running diff A.txt B.txt It gives result as c, but how to store it in a file C.txt? 回答1: The diff utility produces its output on standard output (usually the console). Like any UNIX utility that does this, its output may very simply be redirected into a file like this: diff A.txt B.txt >C.txt This means "execute the command diff with two arguments (the files

How to print the 2 full objects instead of show diff on a python unit test error?

前提是你 提交于 2019-12-22 00:48:10
问题 For example, if I run this test: import unittest class TestAssertEqual(unittest.TestCase): def testString(self): self.maxDiff = None a = u'looooooooooooooooooooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggloooooooo

text comparison/difference algorithm

北城以北 提交于 2019-12-21 23:43:24
问题 Is there a c# library/algorithm that compares 2 texts and displays what is different in them? 回答1: See Diff.Net: Diff.NET is a differencing utility I wrote in C#. It provides side-by-side differencing for files and directories. For files it also provides an overview diff and a line-to-line diff. And it can do a visual difference of binary files. 来源: https://stackoverflow.com/questions/1509771/text-comparison-difference-algorithm