title: Bash piping in OSX prompts command not found, sometimes
body: <p>In the OSX terminal :</p>
  
  <pre><code>du -h | sort -nr
  -bash:  sort: command not found
  
  which sort
  /usr/bin/sort
  </code></pre>
  
  <p>The weird thing is: I tried reproducing the error and it seems to be totally random. My PATH echoed:</p>
  
  <pre><code>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/texbin:/Users/sytycs/.rvm/bin
  </code></pre>
  
  <p>This only occurs when piping and happens with <code>grep</code>, <code>more</code>, <code>less</code> etc.
  Any idea what is causing this?</p>