title: Loop over directories with whitespace in Bash
body: <p>In a bash script, I want to iterate over all the directories in the present working directory and do stuff to them. They may contain special symbols, especially whitespace. How can I do that? I have:</p>
  
  <pre><code>for dir in $( ls -l ./)
  do
      if [ -d ./"$dir" ]
  </code></pre>
  
  <p>but this skips my directories with whitespace in their name. Any help is appreciated.</p>