title: Bash script - find directory, and do something in it. Or find a file, and do something with it
body: <p>This is what I have so far:</p>
  
  <pre><code>for f in 'svn ls repository_dir'; 
  do 
  svn checkout repository_dir/$f/trunk/dir1/dir2/dir3/dir4/needed_dir 
  done
  </code></pre>
  
  <p>This works great for the projects (100's of them) that have the needed_dir in the correct place. But some projects ($f) have their directory structure a little different. So "needed_dir" might be in a different location.</p>
  
  <p><strong>In the do loop</strong>, how can I tell my bash script to:</p>
  
  <p>"Find "needed_dir". If found, check it out."</p>
  
  <p>Or</p>
  
  <p>"Find "needed_file.txt". If found, check it out."</p>
  
  <p>Thank you for any help</p>
  
  <p>EDIT: Sorry, this may be more of a superuser.com question. I actually meant to write it there. But, maybe someone can help me here too!</p>