how to implement diff


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to implement diff
# 1  
Old 11-26-2001
Hammer & Screwdriver 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
# 2  
Old 11-26-2001
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
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
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).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies

2. Shell Programming and Scripting

serach diff filename in diff location using shell scripting

Hi, I am new to shell scripting. please help me to find out the solution. I need a script where we need to read the text file(consists of all file names) and get the file names one by one and append the date suffix for each file name as 'yyyymmdd' . Then search each file if exists... (1 Reply)
Discussion started by: Lucky123
1 Replies

3. Shell Programming and Scripting

.procmailrc and uudeview (put attachments from diff senders to diff folders)

Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies

4. Shell Programming and Scripting

How to implement this?

hi i have a file like 1,"A","B" 2,"C","D" 1,"E","F" 3,"G","H" in output i need like 3,"G","H" 1,"E","F" 2,"C","D" 1,"A","B" (12 Replies)
Discussion started by: angel12345
12 Replies

5. Shell Programming and Scripting

Simulate SVN diff using plain diff

Hi, svn diff does not work very well with 2 local folders, so I am trying to do this diff using diff locally. since there's a bunch of meta files in an svn directory, I want to do a diff that excludes everything EXCEPT *.java files. there seems to be only an --exclude option, so I'm not sure... (3 Replies)
Discussion started by: ackbarr
3 Replies

6. Solaris

new - How i can implement Mirroring

Unix is something new for me, I trying learn about it now. I have download the sun virtualbox software and install solaris 10 into it. It is is like wizard with step by step installation guideline. :) NOw how can i implement mirroring(RAID) into the my new SunOS? can anyone give a briefly list... (14 Replies)
Discussion started by: webster5u
14 Replies

7. Shell Programming and Scripting

Trying to implement 'more' command

Hi all, i'm quite new in the UNIX world. So maybe i'm going to ask simple questions but they are unsolvable for me... I'm trying to implement the 'more' function or kinda of that, for improving my knowledges. But I encountered some problems that i hope u will help me to solve. The code i... (0 Replies)
Discussion started by: Cellofan
0 Replies

8. Shell Programming and Scripting

how to implement this

Hi all, could any of you please help me on my problem.. we are doing FTP (one report out put) from one server to another server through unix shell script program. Due to the network issues, some times FTP process is hanging. So we planned to modify the existing program with the following... (2 Replies)
Discussion started by: kishore_jasthi
2 Replies

9. AIX

how to implement timer

anyone can help me how to implement the timer on AIX? I tried with 'setitimer' and its related functions, but it does not work correctly,the program exited each time. thanks (2 Replies)
Discussion started by: Frank2004
2 Replies

10. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
Login or Register to Ask a Question