#!/usr/bin/perl # findstr by Artem Litivnovich # November 1, 2001 # recursively searches for specified string within specified directory # usage: findstr <directory> <string> use File::Find; my ($sep,$recdepth) = ('/', 3); print "looking in $ARGV[0] for $ARGV[1]\n"; find(\&wanted, $ARGV[0]); sub wanted { undef $/; open FILE, "<$_"; my $text = <FILE>; print "Found $ARGV[1] in $File::Find::name\n" if($text =~ /$ARGV[1 +]/); close(FILE); }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |