-   Linux - Newbie (
-   -   Apply diff to a file (

powah 03-07-2006 01:25 PM

Apply diff to a file
After I do a diff between two files, how to apply the result to a file so that it is updated by the result?

e.g. diff filev1 filev2 > result
I want to use the result to modify a file (filev3) so that it contains the latest difference?

macemoneta 03-07-2006 02:00 PM

After creating the patch with, for example "diff -u" you apply it with the "patch" command. For example:

diff -u filev1 filev2 > result

To then turn file1 into file2, use:

patch < result

All times are GMT -5. The time now is 11:42 AM.