summaryrefslogtreecommitdiffstats
path: root/mpgrep
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-06-24 21:33:33 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-06-24 21:33:33 +0200
commit193c8763447a9ecad4f8ae8d53d82e1e1ca049b3 (patch)
tree938a3b6659c6427f366d70f424689bd94b682a97 /mpgrep
parent0fa1debfd6857edf7298a2478d7c877b29645ff3 (diff)
downloadbin-193c8763447a9ecad4f8ae8d53d82e1e1ca049b3.tar.gz
bin-193c8763447a9ecad4f8ae8d53d82e1e1ca049b3.tar.xz
add mpgrep
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'mpgrep')
-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;
+}