The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Trying to implement case ssunda6 Shell Programming and Scripting 2 03-21-2008 03:55 AM
how to implement this kishore_jasthi Shell Programming and Scripting 2 02-22-2008 02:11 AM
how to implement timer Frank2004 AIX 2 06-09-2004 06:21 PM
how can i implement rlogin jav_v UNIX for Advanced & Expert Users 3 08-29-2002 02:26 PM
diff 2 files; output diff's to 3rd file blt123 Shell Programming and Scripting 2 05-28-2002 08:29 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-26-2001
Registered User
 

Join Date: Nov 2001
Posts: 2
Wink how to implement diff

Hi Does someone know how Unix or Linux implement
'diff' command ? Any good reference or the
algorithm will be better ?

Thanks
Forum Sponsor
  #2  
Old 11-26-2001
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
Well, I assumed you read the man page...
man diff

...otherwise, read...
http://unixhelp.ed.ac.uk/CGI/man-cgi?diff

For example:

File1
1col_1,1col_2,1col_3,1col_4,1col5
2col_1,2col_2,2col_3,2col_4,2col5
3col_1,3col_2,3col_3,3col_4,3col5
4col_1,4col_2,4col_3,4col_4,4col5
5col_1,5col_2,5col_3,5col_4,5col5

File2
1col_1,1col_2,1col_3,1col_4,1col5
2col_1,2col_2,2col_3,2col_4,2col5
0col_1,3col_2,3col_3,3col_4,3col5
4col_1,4col_2,4col_3,4col_4,4col5
5col_1,0col_2,5col_3,5col_4,5col5

diff File1 File2

3c3
< 3col_1,3col_2,3col_3,3col_4,3col5
---
> 0col_1,3col_2,3col_3,3col_4,3col5
5c5
< 5col_1,5col_2,5col_3,5col_4,5col5
---
> 5col_1,0col_2,5col_3,5col_4,5col5

...lines starting with "<" belong to the first file (File1).
lines starting with ">" belong to the second file (File2).

Is there somthing specific you are trying to do with diff?
  #3  
Old 11-26-2001
Registered User
 

Join Date: Nov 2001
Posts: 2
Thank you so much.

Because currently we have two programmers working on one file. I am just wondering how to combine their work daily. And I know in CVS they use
'diff' to compare different version's file. Or maybe you have any good suggestions?

Thanks
  #4  
Old 11-26-2001
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
Normally, CVS can be used to "check out for edit" source modules
and prevent (in an advisory manner) more than 1 person
from making changes to a single module at the same time.
This way, changes made by one person can safely be made
are are sure to be in the "check out for edit" by the next person.
If it is necessary to have more than one person working on
the same source module (and in some cases it is - but rarely)
you can utilize the CVS "merge" function to merge the changes
from both files into one. May I suggest your developers
familiarize themselves with the CVS docs...

http://www.gnu.org/manual/cvs/index.html

...it will benifit them greatly.
The CVS "diff" and UNIX "diff" are two different things.
I was describing the UNIX command diff(1).
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0