title: How to delete a certain path from $PATH on mac
body: <p>I need to get rid of <code>/Library/Frameworks/Python.framework/Versions/2.7/bin</code> in my <code>$PATH</code> variable on Mac OS X Lion. I opened several files, which add something to the path but do not find the location which adds the python path. Here is the output of several files and the path variable:</p>
  
  <p><code>echo $PATH</code> returns</p>
  
  <pre><code>/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/Users/friedrich/.rvm/gems/ruby-1.9.3-p362/bin:/Users/friedrich/.rvm/gems/ruby-1.9.3-p362@global/bin:/Users/friedrich/.rvm/rubies/ruby-1.9.3-p362/bin:/Users/friedrich/.rvm/bin:/Users/friedrich/.rbenv/shims:/Users/friedrich/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin
  </code></pre>
  
  <p>File <code>/etc/paths/</code></p>
  
  <pre><code>/usr/local/bin
  /usr/bin
  /bin
  /usr/sbin
  /sbin
  </code></pre>
  
  <p>File <code>~/.profile</code></p>
  
  <pre><code>export PATH=$PATH:/usr/local/git/bin:/usr/local/Cellar/todo-txt/2.9/bin
  </code></pre>
  
  <p>File <code>~/.bash_profile</code></p>
  
  <pre><code>export PATH="$HOME/.rbenv/bin:$PATH"
  eval "$(rbenv init -)"
  
  [[ -s "$HOME/.rvm/scripts/rvm" ]] &amp;&amp; source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
  
  # todo.txt script path
  source /usr/local/Cellar/todo-txt/2.9/etc/bash_completion.d/todo_completion complete -F _todo t
  
  # MacPorts Installer addition on 2013-03-01_at_21:26:56: adding an appropriate PATH variable for use with MacPorts.
  export PATH=/opt/local/bin:/opt/local/sbin:$PATH
  # Finished adapting your PATH environment variable for use with MacPorts.
  </code></pre>
  
  <p>The last file which adds something to the path seems to be <code>.bash_profile</code> adding <code>export PATH=/opt/local/bin:/opt/local/sbin:$PATH</code>, so I need the file adding something one step before that.</p>