title: Apply a script to subdirectories
body: <p>I have read many times that if I want to execute something over all subdirectories I should run something like one of these:</p>
  
  <p><code>find . -name '*' -exec command arguments {} \;</code></p>
  
  <p><code>find . -type f -print0 | xargs -0 command arguments</code></p>
  
  <p><code>find . -type f | xargs -I {} command arguments {} arguments</code></p>
  
  <p>The problem is that it works well with corefunctions, but not as expected when the command is a user-defined function or a script. How to fix it?</p>
  
  <p>So what I am looking for is a line of code or a script in which I can replace <code>command</code> for <code>myfunction</code> or <code>myscript.sh</code> and it goes to every single subdirectory from current directory and executes such function or script there, with whatever arguments I supply.</p>
  
  <p>Explaining in another way, I want something to work over all subdirectories as nicely as <code>for file in *; do command_myfunction_or_script.sh arguments $file; done</code> works over current directory.</p>