title: Wrapping shell built-ins
body: <p>I'd like to wrap the built-in Bash command <code>export</code> so that it logs the variable being exported.</p>
  <p>In a language like JavaScript, if I want to wrap a built-in, I can save a reference to the original object.  So, for instance, we could make the built-in <code>alert</code> capitalize its argument:</p>
  <pre><code>var originalAlert = alert;
  alert = function(s) {
    originalAlert(s.toUpperCase());
  }
  </code></pre>
  <p>But since Bash doesn't have references like this, I don't think it's possible to wrap <code>export</code> with the same technique.</p>
  <p>Am I wrong? Is there some way to wrap a bash built-in like <code>export</code>?</p>