这里有一个脚本:
if [[ $# < 2 ]]; then
echo "Usage: $0 REGEX TARGET..."
echo "where REGEX is a regular expression for grep"
echo "and TARGET... is a list of SVN repositories"
exit
fi
regex=$1
shift
for svnroot in $@; do
for path in $(svn ls --recursive $svnroot); do
if [[ $path != */ ]]; then
svn cat $svnroot/$path \
| grep --label="$svnroot/$path" --with-filename $regex
fi
done
done