Hi, 
I used to use find, a for loop and awk to extract data from a list of
files returned by find. 

Now I want to use file::find  and perl to this.

 use vars qw/*name *dir *prune/;
 *name   = *File::Find::name;
 *dir    = *File::Find::dir;
 *prune  = *File::Find::prune;
 
 my $directories_to_seach="/home/jim";
  
  
  sub wanted;
  
  # Traverse desired filesystems
  File::Find::find({wanted => \&wanted}, $directories_to_seach);
  exit;
  
  sub wanted {
  /regex/s
     && print("$name\n");
  }

my question is how to do in a native, elegant perl way for my bash
script?

for file in `find . -name "*pattern*"`
do 
    zcat $file|awk '$2 == "BP" {print $17 $18}'|\
    echo 
done


Thank you!

Jim

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to