Created
February 24, 2015 05:54
-
-
Save thirdknife/ea2b186e40e932dcda35 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/awk -f | |
| BEGIN { | |
| OFS="*"; | |
| split(pats, a, "|") | |
| } | |
| { | |
| pats="" | |
| for (e in a) { | |
| if (match($0, a[e])) { | |
| pats=(pats?pats":":"") substr($0,RSTART,RLENGTH) | |
| } | |
| } | |
| if (pats) | |
| print FILENAME,NR,pats,$0 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment