title: Script fails with spaces in directory names
body: <p>I have a really easy question, I have found a bunch of similar questions answered but none that solved this for me.</p>
  
  <p>I have a shell script that goes through a directory and prints out the number of files and directories in a sub directory, followed by the directory name. </p>
  
  <p>However it fails with directories with spaces, it attempts to use each word as a new argument. I have tried putting $dir in quotations but that doesn't help. Perhaps because its already in the echo quotations.</p>
  
  <pre><code>for dir in `find . -mindepth 1 -maxdepth 1 -type d`
  do
      echo -e "`ls -1 $dir | wc -l`\t$dir"
  done
  </code></pre>
  
  <p>Thanks in advance for your help :)</p>