title: How to cd into a directory with space in the name?
body: <p>I'm attempting to get into the directory <code>/cygdrive/c/Users/my dir/Documents</code>:</p>
  <pre><code>$ DOCS=&quot;/cygdrive/c/Users/my\ dir/Documents&quot;
  
  $ echo $DOCS
  /cygdrive/c/Users/my\ dir/Documents
  
  $ cd $DOCS
  -bash: cd: /cygdrive/c/Users/my\: No such file or directory
  
  $ cd /cygdrive/c/Users/my\ dir/Documents
  (success)
  </code></pre>
  <p>When I manually type it in, the backspace does its escape character thing, but not when I use parameter expansion with the variable <code>DOCS</code>.</p>
  <p>I tried other variations such as no backslash.</p>
  <pre><code>$ DOCS=/cygdrive/c/Users\ dir/Documents
  
  $ echo $DOCS
  /cygdrive/c/Users/my dir/Documents
  
  $ cd $DOCS
  -bash: cd: /cygdrive/c/Users/my: No such file or directory
  </code></pre>
  <p>or</p>
  <pre><code>$ DOCS=&quot;/cygdrive/c/Users/my dir/Documents&quot;
  
  $ echo $DOCS
  /cygdrive/c/Users/my dir/Documents
  
  $ cd $DOCS
  -bash: cd: /cygdrive/c/Users/my: No such file or directory
  </code></pre>
  <p>The same happens for <code>$HOME</code>:</p>
  <pre><code>$ echo $HOME
  /home/my dir
  </code></pre>
  <p><code>cd $HOME</code> doesn't work either. Quotes must be put around it.</p>
  <p>What the heck:</p>
  <pre><code>$ DOCS=&quot;\&quot;/cygdrive/c/Users/my dir/Documents\&quot;&quot;
  
  $ echo $DOCS
  &quot;/cygdrive/c/Users/my dir/Documents&quot;
  
  $ cd $DOCS
  -bash: cd: &quot;/cygdrive/c/Users/my: No such file or directory
  </code></pre>