--- nfo/perl/scripts/archiver/bin/finder.pl 2003/02/01 02:52:32 1.2 +++ nfo/perl/scripts/archiver/bin/finder.pl 2003/02/01 06:41:21 1.3 @@ -1,9 +1,12 @@ #!/usr/bin/perl ## ------------------------------------------------------------------------ -## $Id: finder.pl,v 1.2 2003/02/01 02:52:32 joko Exp $ +## $Id: finder.pl,v 1.3 2003/02/01 06:41:21 joko Exp $ ## ------------------------------------------------------------------------ ## $Log: finder.pl,v $ +## Revision 1.3 2003/02/01 06:41:21 joko +## + added mechanism using option 'regex-exclude' +## ## Revision 1.2 2003/02/01 02:52:32 joko ## + minor update ## @@ -29,6 +32,11 @@ - finder.pl --regex=/CVS/Root$ /tmp/cvsroot finds all files/directories matching 'regex' in path '/tmp/cvsroot' and below (recursively) + - todo: + x exclude mechanism (use regex-exclude) + o remember all matched entries while processing, show at end of processing in report + o add some statistics (count-matched/count-all) + =cut @@ -55,8 +63,12 @@ sub wanted { my $pattern = $settings->{options}->{regex}; + my $pattern_exclude = $settings->{options}->{'regex-exclude'}; #print "pattern: $pattern", "\n"; if ($File::Find::name =~ m/$pattern/) { + if ($pattern_exclude && $File::Find::name =~ m/$pattern_exclude/) { + return; + } print $File::Find::name, "\n"; #replaceInFile($File::Find::name); #exit;