#!/bin/bash set -v function search(){ for element in `ls $1` do dir=$1"/"$element echo $dir svn list -R --verbose file://$dir |grep -i '文件名' done } root_dir="/opt/svn" search $root_dir