title: vagrant - .bashrc has correct exports, but variables aren't correct
body: <p>I didn't write the vagrant file - it was made by a colleague of mine, and I'm not overly familiar with writing them, but based on what they look like, I can understand what it's doing to an extent. I'm running Windows and a precise32 virtualbox, and emulating some sort of Linux system.  </p>
  
  <p>Basically what's happening is the vagrant file executes bootstrap.sh, which contains the following line:</p>
  
  <pre><code>cat /vagrant/support/bash-template.dat &gt;&gt; /home/vagrant/.bashrc
  </code></pre>
  
  <p>support/bash-template.dat contains</p>
  
  <pre><code>export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
  </code></pre>
  
  <p>When I check .bashrc after ssh'ing into vagrant, it has this line at the bottom. </p>
  
  <p>If I do</p>
  
  <pre><code>&gt; echo $JAVA_HOME
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>/usr/lib/jvm/java-7-openjdk-i386
  </code></pre>
  
  <p>But if I do</p>
  
  <pre><code>&gt;cd $JAVA_HOME
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>: No file or directorya-7-openjdk-i386
  </code></pre>
  
  <p>What's going on here? It just mashes the latter half of the variable with the error message.</p>
  
  <p>And the directory exists! If I go from root, I can do</p>
  
  <pre><code>~&gt; cd /usr/lib/jvm/java-7-openjdk-i386
  </code></pre>
  
  <p>And it brings me to the java home place.
  I can reexport variables in the shell, and they work, but it would be very helpful to be able to do it from .bashrc so I don't have to reexport all 15 variables every single time I log on.
  Thanks in advance for any help. </p>