Skip to content

Instantly share code, notes, and snippets.

@mhl
Created August 25, 2015 11:07
Show Gist options
  • Save mhl/96d675e2bb074502f12c to your computer and use it in GitHub Desktop.
Save mhl/96d675e2bb074502f12c to your computer and use it in GitHub Desktop.
#!/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