0

I see this, but it does NOT quite give me what I need. Diff files present in two different directories

I want to diff ALL the pom.xml files, but from two different directory trees in a multi-module struncture. So I have

dir1/pom.xml
dir1/module1/pom.xml
dir1/module1/project1/pom.xml
dir1/module2/pom.xml
etc...

dir2/pom.xml
dir2/module1/pom.xml
dir2/module1/project1/pom.xml
dir2/module2/pom.xml
etc...

I want to diff ALL the pom.xml files, and ONLY the pom.xml files, between dir1 and dir2. I'm currently using SVN, so either a sed or svn-specific command may be helpful. Thanks!

2 Answers 2

0

Assuming the same file names exist in both directories:

find dir1 -name pom.xml | while IFS= read -r file1 do file2="${file1//dir1/dir2}" diff "$file1" "$file2" done 

If not, just add a test for the file existing and a second loop going the other direction.

Sign up to request clarification or add additional context in comments.

Comments

0

If the folder structure is the same, maybe you could be running:

cd dir1 find . -name pom.xml -exec diff {} ../dir2/{} \; 

I can't test it right now...

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.