some-usable-scripts/perl/grep.pl

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;
# }
#};