summaryrefslogtreecommitdiffstats
path: root/mpgrep
blob: f4c90ee099f6de4e2afffd25c38fc13d3adf7948 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
#
# display the input line(s) if all patterns match
#
use warnings;
use strict;

my @patterns = @ARGV;

my $pattern;

LINE: while (<STDIN>) {
	for $pattern (@patterns) {
		next LINE unless m/$pattern/i;
	}
	print;
}