summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmpgrep14
1 files changed, 14 insertions, 0 deletions
diff --git a/mpgrep b/mpgrep
new file mode 100755
index 0000000..aca092b
--- /dev/null
+++ b/mpgrep
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+my @patterns = @ARGV;
+
+my $pattern;
+
+LINE: while (<STDIN>) {
+ for $pattern (@patterns) {
+ next LINE unless m/$pattern/;
+ }
+ print;
+}