in reply to compare two files line by line and perform a diff on each coressponding line
use strict; use warnings; use File::Basename; my @tst1 = qw( /dir1/file1 /dir1/file2 /dir1/file3 ); my @tst2 = qw( /dir2/file1 /dir2/file2 /dir2/file3 ); chomp @tst1; chomp @tst2; for my $t1 (@tst1) { for my $t2 (@tst2) { next unless basename($t1) eq basename($t2); my $status = system "diff $t1 $t2 > /dev/null"; print "$status\n"; } }
|
---|