Created
March 27, 2012 14:07
-
-
Save halfninja/2216171 to your computer and use it in GitHub Desktop.
Recursive grep
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 | |
function usage() { | |
echo "Usage: deepgrep search-term file-pattern" | |
} | |
if [[ "$1" == "" || "$2" == "" ]]; then | |
usage | |
exit 1 | |
fi | |
find . -name "$2" -exec grep -H "$1" {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment