diff options
Diffstat (limited to 'mysql-test/include/grep.inc')
-rw-r--r-- | mysql-test/include/grep.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/include/grep.inc b/mysql-test/include/grep.inc new file mode 100644 index 00000000..9ce7cddb --- /dev/null +++ b/mysql-test/include/grep.inc @@ -0,0 +1,16 @@ +# Grep file for regular expression and output to STDOUT +# +# Usage: +# --let $grep_file= /path/to/your/file +# --let $grep_regex= your_regex_string +# --source include/grep.inc + +--perl + open (my $fh, "<", "$ENV{grep_file}") or die $!; + while (<$fh>) + { + /$ENV{grep_regex}/ && + print; + } + close $fh; +EOF |