title: Export in BASH script and source command
body: <p>According to <a href="https://stackoverflow.com/questions/16618071/can-i-export-a-variable-to-the-environment-from-a-bash-script-without-sourcing-i">this answer</a>, simply placing the <code>export</code> command in a <code>bash</code> script does not affect an environment variable unless the <code>source</code> command is used.  However, after installing Anaconda for Python, I noticed the installer added the following line in the shell script <code>.bashrc</code>:</p>
  
  <pre><code>export PATH="/host/anaconda2/bin:$PATH"
  </code></pre>
  
  <p>Running <code>printenv</code> reveals this statement did indeed seem to have the desired effect.  My questions are, how does the export statement in the script effect the environment variables without the <code>source</code> command, and why is the <code>source</code> command usually needed to have this effect?  I.e., why doesn't the script just perform the <code>export</code> statement without the <code>source</code> command/</p>