Script to Find Diff from two folders


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Script to Find Diff from two folders
# 1  
Old 07-31-2006
Script to Find Diff from two folders

Hi

I would like to find the diff between two folders:

Ex:
Folder:1
html.java
go.java
ten.java

Folder:2html.java
go.java
ten.java
you.java

Questions comes:
Folder:1 contains a files with old version, know the files were modified and updated with the new version in Folder2.

I need to find out the script that prints the difference and versions, lastdate modified, if any code changes have done!

Can any one let me know if you have done the same

Regards
Krishna
Smilie Smilie
# 2  
Old 07-31-2006
I do not know how you get versioning information on your system, so I'll pretend ident does what is needed.v try something like this

Code:
#!/bin/ksh

find /path/to/folder1 -print | \
while read file 
do
    echo "\n\n-----------------------------------"
    ls -l "$file"
    ident "$file"
    file2=/path/to/folder2/"`basename $file`"
    ls -l "$file2"
    ident "$file2"
    diff "$file" "$file2"
done > ~/diff.lis

# 3  
Old 08-01-2006
Script to Find Diff from two folders

Hi Jim,

Thanks for your effort. i do version with CVS. and after checking out from cvs from two different baraches i need to compare the two braches in cvs i use command like " cvs rdiff -s -r Release_1 -r Release_1.1 > diff.txt"

by using the above command i will get the details of the two releases in the diff.txt. Know i need to print the results from this diff.txt file like
1) Version
2) date modified
3) code change details (i.e, line numbers)

so, if any one has done the script for the above can you please share with me.

Regards
Krishna Smilie Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find diff between two patterns in two files and append

Hi, I'm a newbie at programming in Unix, and I seem to have a task that is greater than I can handle. Trying to learn awk by the way (but in the end, i just need something that works). My goal is to compare two files and output the difference between the two. I've been reading, and I think I... (5 Replies)
Discussion started by: legato22
5 Replies

2. UNIX for Dummies Questions & Answers

efficient way to find diff

I have two files A and B. I want to create file C which is A - B. I am currently using grep -v -f B A > C Is there a more efficient way. Files A and B are both large files Thanks (3 Replies)
Discussion started by: chrisjones
3 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. UNIX for Dummies Questions & Answers

Find folders that do NOT contain a certain file

I'm no linux guru so any help would be greatly appreciated! I need to output all folders that do not contain a file of a certain extension. Currently I have the following find / ! -name '*.txt' -printf %h\\n This doesn't work because although it finds folders that do not contain *.txt,... (2 Replies)
Discussion started by: hodnov
2 Replies

5. Shell Programming and Scripting

Find empty folders

In current folder, there are many subfolders, subfolder's subfolders... under it. How can I find out the empty folders with no files in it. I only need the top folder list. For example, I have folders like below: a/b/c a/b/x/x.txt a/s a/s/y I need get the folder a/s, but not... (6 Replies)
Discussion started by: rdcwayx
6 Replies

6. Shell Programming and Scripting

to find the diff in a date

Hello, i have a variable where the present date is going to save. and i have another variable where the another date which will of higher value is going to save. I need to find the difference with respect to date,month and year. What the need is to send an e-mail if the difference in... (2 Replies)
Discussion started by: nagendramv
2 Replies

7. Shell Programming and Scripting

Script to find folders with spaces and end of files and directories

Hi I need a script that can search through a set of directories and can locate any file or directory that has a space at the end Filename(space) Foldername(space) I then need to remove that space within the script Hope someone can help thanks in advance Treds (8 Replies)
Discussion started by: treds
8 Replies

8. Shell Programming and Scripting

Need a script find the folders and execute a code

I need a script which can search for two files in location /share/point/ which has year and month stamps example 1) Extract200806.txt 2)file_new200805.csv If these files exists then it should run a code named abc.sas (3 Replies)
Discussion started by: reachsarath
3 Replies

9. UNIX for Dummies Questions & Answers

Find and rename all folders with name X.

Is there a command I can use to rename all directories with a certain name to a new name. For instance from my root directory I want to change all folders named '123' to '321' that are in the root directory or any subdirectory. Thanks in advance! (6 Replies)
Discussion started by: mkingrey
6 Replies

10. UNIX for Advanced & Expert Users

find only folders

is there an option in find command to search only for folders (not subfolders). thx (1 Reply)
Discussion started by: melanie_pfefer
1 Replies
Login or Register to Ask a Question