in reply to Getting Filenames that contains a particular string recursively From a Directory
#!/usr/bin/perl -w use strict; open (FIND_CMD, "find /home/modules |"); chomp (my @findArr = <FIND_CMD>); close (FIND_CMD); my $pattern = '.pm$'; my $FilePattern = "sub user_method"; my $ResultFilePath = '/tmp/ModuleSearch'; foreach my $File ( @findArr ) { next if ( $File !~ m/$pattern/ ); system ("grep -iHl \"$FilePattern\" \"$File\" >> $ResultFilePath ") +; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting Filenames that contains a particular string recursively From a Directory
by blazar (Canon) on Dec 06, 2005 at 13:07 UTC | |
by Anonymous Monk on Dec 06, 2005 at 14:33 UTC | |
by blazar (Canon) on Dec 06, 2005 at 14:48 UTC | |
|
Re^2: Getting Filenames that contains a particular string recursively From a Directory
by Corion (Patriarch) on Dec 06, 2005 at 10:56 UTC | |
|