Merge different versions of file in UNIX | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Merge different versions of file in UNIX

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-18-2013
AjMyTechGroup AjMyTechGroup is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 22 January 2013, 1:50 AM EST
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Code Merge different versions of file in UNIX

Hello Experts,
I want to merge my local file (File1) with the changes in remote server (File1). For Example:

File1 contents are... (file @ remote server)
ABC
<blankLine>
GHI
<EOF>


I, as USER#1, have updated the contents of File1 in my local as...
ABC
DEFGhi
<blankLine>
JKL
<blankLine><EOF>

meanwhile, some USER#2, have already commited the new changes in remote server repository...now the File1 contents, @ remote server, are...
ABC
123DEF
GHI
<EOF>

Now, I don't want to simply replace remote File1 with my local File1 coz by doing so, I might overwrite on USER#2 changes. So now I need to merge the latest file in remote server repository with my local file changes (without changing the sequence). Can anyone please help?
Sponsored Links
    #2  
Old 01-18-2013
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
who?
 
Join Date: Dec 2003
Last Activity: 14 September 2014, 4:01 PM EDT
Location: /dev/ph
Posts: 4,802
Thanks: 63
Thanked 425 Times in 394 Posts
The correct way to do this is to use file revision control. See Revision control.
The Following User Says Thank You to fpmurphy For This Useful Post:
AjMyTechGroup (01-21-2013)
Sponsored Links
    #3  
Old 01-21-2013
AjMyTechGroup AjMyTechGroup is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 22 January 2013, 1:50 AM EST
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Thank you fpmurphy for replying to the query!

We already have file revision control in place but just want to see whether the same can be done through UNIX.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
merge two tab delimited file with exact same number of rows in unix/linux mary271 UNIX for Advanced & Expert Users 2 01-10-2012 02:51 PM
Differences between different versions of Unix Straitsfan UNIX for Dummies Questions & Answers 1 03-02-2009 08:49 PM
Versions of UNIX oliver79 UNIX for Dummies Questions & Answers 4 06-28-2006 10:41 AM
Need to know all versions of Unix jpawlicki2 UNIX Desktop for Dummies Questions & Answers 2 08-05-2003 11:46 AM
What different versions of UNIX are there? AMDPwred UNIX for Dummies Questions & Answers 3 05-21-2002 02:50 AM



All times are GMT -4. The time now is 10:02 PM.