When I want to compare a local file with a remote file, any of these usually works:
$ ssh remote cat file | diff file -
$ diff file <(ssh remote cat file)
However, sometimes (especially when the password is needed) they fail like this:
$ ssh remote cat file | diff file -
1,162d0
< ...
< ...
Password:
Here, diff doesn't wait for ssh to complete and considers the second file empty.
I'm not much of a unix guy so I'll just go ahead and ask:
I have a following problem - two folders with plenty of subfolders. I need to diff them.
I tried this:
diff -drupN vanila_kernel_3.0.8 my_kernel_3.0.8 > kernel.patch
and that results in a 85mb file...
I can create a patch for a file with the following:
Code:
diff -uN OldFile NewFile > patch.txt
then apply the patch with:
Code:
patch OldFile < patch.txt
I tried this with directories:
Code:
diff -uN OldDirectory NewDirectory > patch.txt
it seemed to work fine. Then I tried to apply the patch:
Yes, there is. You save a copy of the original file somewhere else, then edit the file. Afterwards you run diff to create a patch, which you can apply later in the PKGBUILD. For an introduction to patch and diff see e.g. http://jungels.net/articles/diff-patch-ten-minutes.html. For an example of a PKGBUILD that uses patch, see e.g. http://gitorious.org/chakra-packages/ap … e/PKGBUILD.
Hello,
I wanted to compare two folders to see if all files copied were indeed identical and i got this weird output:
=======================================
Dave@Dave-CMP ~/test
$ diff -r /cygdrive/f/Imp/ /cygdrive/g/Imp/ > diffImp
[1]- Done diff -r /cygdrive/f/Imp/ /cygdrive/g/Imp/ > diffImp
[2]+ Done diff -r /cygdrive/f/Imp/ /cygdrive/g
i have two text files test1.txt and test2.txt with content as
test1.txt
1
2
test2.txt
1
2
3
4
what i have achieved with the txt files is a difference of both files in a third file as
diff test2.txt test1.txt > test.patch
patch test.txt < test.patch
in text.txt i have the resultant difference of both files.
Now i am doing the same with CSV files.
I'm trying to compare files on the root file system with a backup, and I'd like the comparison to work a bit like git or svn diff when a file has been added or removed - That is, display the full file diff. diff unfortunately just prints a No such file or directory message, which is not very useful.
Hi all, I kwow there are many ways to insert string into a files all over the forum, but I need to make that process like patch do because in the same file I can have the same pattern in many locations, for that I need the send two patterns, one for "before" and another for the "after".
I cannot be capable to do it with patch and diff because the original file to be patched ca
So I'm currently developing an automated test system and I'm verifying my results by running a set of baselined data through and comparing the output (which is in a txt file) to a baseline results file. So of course I'm just using the diff command. Unfortunately each time I run the test there are 2 values that are changed.