Last active
January 2, 2016 00:49
-
-
Save sriramster/8225836 to your computer and use it in GitHub Desktop.
Awk mail search pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pattern from command Line | |
BEGIN { | |
pattern=ARGV[13] | |
_pattern=pattern | |
} | |
{ | |
matches = ($0 ~ _pattern) | |
if(matches) { | |
print "Matched Line " $0 "@ " FILENAME | |
} | |
} | |
# usage(): awk -f mail.awk $path $pattern |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment