in reply to Re^2: in Perl find call looking to exclude folder and ignore duplicate finds.
in thread in Perl find call looking to exclude folder and ignore duplicate finds.
use Cwd qw( abs_path ); my %seen; my $processed_files = 0; find ({ wanted => sub { $File::Find::dir =~ m{^/data/logs/master\b} and return; -f && m/auth\.log$/ or return; $seen{abs_path ($_)}++ and return; save_file ($File::Find::name); $processed_files++; }, follow => 1, }, @ARGV);
|
|---|