Created
November 16, 2012 17:44
-
-
Save jbranchaud/4089338 to your computer and use it in GitHub Desktop.
Quick search through a large Java project for a string
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
#!/bin/bash | |
# the first argument is the string you are looking for --> $1 | |
searchString="$1" | |
for f in `find . -type f -name "*.java"` | |
do | |
result=`grep "$searchString" $f` | |
if [ "$result" != "" ] | |
then | |
echo $f | |
echo "| $result" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment