/[cvs]/nfo/perl/scripts/archiver/bin/finder.pl
ViewVC logotype

Diff of /nfo/perl/scripts/archiver/bin/finder.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by joko, Sat Feb 1 02:52:32 2003 UTC revision 1.3 by joko, Sat Feb 1 06:41:21 2003 UTC
# Line 4  Line 4 
4  ##  $Id$  ##  $Id$
5  ## ------------------------------------------------------------------------  ## ------------------------------------------------------------------------
6  ##  $Log$  ##  $Log$
7    ##  Revision 1.3  2003/02/01 06:41:21  joko
8    ##  + added mechanism using option 'regex-exclude'
9    ##
10  ##  Revision 1.2  2003/02/01 02:52:32  joko  ##  Revision 1.2  2003/02/01 02:52:32  joko
11  ##  + minor update  ##  + minor update
12  ##  ##
# Line 29  Line 32 
32      - finder.pl --regex=/CVS/Root$ /tmp/cvsroot      - finder.pl --regex=/CVS/Root$ /tmp/cvsroot
33          finds all files/directories matching 'regex' in path '/tmp/cvsroot' and below (recursively)          finds all files/directories matching 'regex' in path '/tmp/cvsroot' and below (recursively)
34    
35      - todo:
36        x exclude mechanism (use regex-exclude)
37        o remember all matched entries while processing, show at end of processing in report
38        o add some statistics (count-matched/count-all)
39    
40  =cut  =cut
41    
42    
# Line 55  my $settings; Line 63  my $settings;
63    
64  sub wanted {  sub wanted {
65    my $pattern = $settings->{options}->{regex};    my $pattern = $settings->{options}->{regex};
66      my $pattern_exclude = $settings->{options}->{'regex-exclude'};
67    #print "pattern: $pattern", "\n";    #print "pattern: $pattern", "\n";
68    if ($File::Find::name =~ m/$pattern/) {    if ($File::Find::name =~ m/$pattern/) {
69        if ($pattern_exclude && $File::Find::name =~ m/$pattern_exclude/) {
70          return;
71        }
72      print $File::Find::name, "\n";      print $File::Find::name, "\n";
73      #replaceInFile($File::Find::name);      #replaceInFile($File::Find::name);
74      #exit;      #exit;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed