title: how to dynamically add to $PATH on Linux / OS X
body: <p>I know that in order to add a directory to my OS X path, I'm supposed to edit my <code>~/.bashrc</code> or <code>~/.profile</code> file to add something like:</p>
  
  <pre><code>export PATH=&lt;&lt;somepath&gt;&gt;:$PATH
  </code></pre>
  
  <p>I'm pretty new to bash and was wondering: would it be possible to edit, for instance, my <code>~/.bash_profile</code> file so that I could do this dynamically, so that from the command line I could permanently add a directory to my path by doing something like</p>
  
  <pre><code>addpath &lt;&lt;somepath&gt;&gt;
  </code></pre>
  
  <p>instead?</p>