LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 03-07-2006, 02:25 PM   #1
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Rep: Reputation: 30
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?
 
Old 03-07-2006, 03:00 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chcon: can't apply partial context to unlabeled file... DevNRG Linux - General 7 10-12-2005 05:01 PM
.diff files. How do I apply them? tardigrade Linux - Software 1 08-14-2005 10:05 PM
What is *.diff file? carboncopy Slackware 1 05-19-2004 11:26 AM
DIFF (or other file comparison) ciscokid1967 Linux - General 1 12-11-2003 03:13 PM
I have a patch (diff file). What now? Gurduloo Linux - Newbie 2 05-27-2003 03:20 PM


All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration