Created
August 25, 2015 11:07
-
-
Save mhl/96d675e2bb074502f12c 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
#!/bin/sh | |
GREEN=$(tput setaf 2) | |
RESET=$(tput sgr0) | |
export GIT_PAGER=cat | |
for d in * | |
do | |
if [ -d "$d" ] || [ -L "$d" ] | |
then | |
echo -n "$GREEN" | |
echo -n In repository: $d | |
echo "$RESET" | |
(cd "$d" && git grep "$@") | sed "s,^,$d/," | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment