in reply to Listing Files
#!/usr/bin/perl -w use strict; use File::Find; my @startdirs = qw(/home /var/dir); # list of startdirectories find ( sub { if( /\.html$/ ) { # $_ contains filename without path open (HTML, $File::Find::name) # filename with path or warn "couldn't read from $File::Find::name: $!\n"; while (<HTML>) { if ( /\bExpired\b/i ){ # if Expired found print "$File::Find::name\n"; last; # skip rest of file } # if } # while close (HTML); } # if .html }, @startdirs);
Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: Listing Files
by merlyn (Sage) on Mar 01, 2002 at 15:19 UTC | |
by Anonymous Monk on Mar 01, 2002 at 16:15 UTC | |
by lordsuess (Scribe) on Mar 02, 2002 at 01:43 UTC | |
by merlyn (Sage) on Mar 02, 2002 at 07:46 UTC | |
by lordsuess (Scribe) on Mar 04, 2002 at 13:56 UTC | |
by merlyn (Sage) on Mar 04, 2002 at 14:38 UTC | |
| |
|
Re: Re: Listing Files
by Anonymous Monk on Mar 01, 2002 at 16:24 UTC | |
by strat (Canon) on Mar 01, 2002 at 18:06 UTC | |
by Anonymous Monk on Mar 01, 2002 at 19:57 UTC |