Created
January 10, 2014 12:46
-
-
Save gorillamoe/8351353 to your computer and use it in GitHub Desktop.
Grep in files that are "revisioned" by filename like: test.1.xml, test.2.xml, test.3.xml. This script will only grep in the latest (highest number) file. It searches trough all subdirs too.
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
find . -name \*.xml -type f -print | cut -c3- | sort -k2 -t. -n -r | awk 'BEGIN{FS="."} a[$1] {next} {a[$1]=1} 1' | xargs grep mooo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment