Hi there
Perhaps this thread may give you pointers on what you are trying to do, it includes code examples for a similar question a few weeks ago:
Thread on bash searching
From what you have shown wouldn't the find command be more appropriate for you though?
ie:
find . -name filename -print
That will recurusivly (sp?) search through directories finding all occurances of the file called filename.
HTH
Ben