divers/perl/grep2.pl
2012-01-05 12:02:51 +01:00

13 lines
202 B
Perl
Executable file

#!/usr/bin/perl
$motif=$ARGV[0];
shift;
foreach $f (@ARGV)
{
open(F,"<$f") || die "Impossible de lire le fichier $f : $!";
while(<F>)
{
print "Motif trouvé dans $f : $_ \n" if(/$motif/);
};
}