some-usable-scripts/perl/grep.pl
2012-06-27 21:42:23 +02:00

20 lines
229 B
Perl
Executable File

#!/usr/bin/perl -w
$motif = shift(@ARGV);
# $motif=$ARGV[0]
#Shift
# Manière non explicite
while(<>)
{
print if(/$motif/);
};
# Manière explicite
#while($ligne = <>)
#{
# if($ligne =~ /$motif/)
# {
# print $ligne;
# }
#};