Solved

perl, how to compare file contents from one folder to another

Posted on 2011-09-19
3
346 Views
Last Modified: 2012-05-12
There are 3 files in dir1.  I want to check if the 3 files are the same in dir2, so the three files exist in dir2 and have the same exact content.  Note, dir2 may have other files.
0
Comment
Question by:rgbcof
3 Comments
 
LVL 12

Expert Comment

by:tel2
ID: 36565712
How about a recursive diff:
    diff -r dir1 dir2
0
 
LVL 4

Accepted Solution

by:
Ryan Weaver earned 500 total points
ID: 36566237
You could use the File::Dircmp module to find the file name differences and combine that with File::Compare to check the files of the same name.
0
 

Author Closing Comment

by:rgbcof
ID: 36568516
Fryguy,

Thanks for the tip.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best way to virtualise a remote Linux server 2 67
Linux VM 6 88
open source backup solution 1 29
fedora linux on laptop - setup sendmail - or some kind of email 5 45
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question