Skip to content

Instantly share code, notes, and snippets.

@sriramster
Last active January 2, 2016 00:49
Show Gist options
  • Save sriramster/8225836 to your computer and use it in GitHub Desktop.
Save sriramster/8225836 to your computer and use it in GitHub Desktop.
Awk mail search pattern
# 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