Created
December 13, 2015 22:57
-
-
Save kevinhooke/fc1a6a49547d55ff9f44 to your computer and use it in GitHub Desktop.
bash script - find files matching pattern, grep file content for pattern, pipe results to file
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
#!/bin/bash | |
for f in $(find -E . -regex ".*ext1|.*ext2|.*ext3") | |
do | |
echo $f $'\n' $(egrep -o 'TextAtStartOfLine:[[:space:]]*[[:digit:]]+' $f) $'\n' >> report"$(date)".txt | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment