title: How do I rename a bash function?
body: <p>I am developing some convenience wrappers around another software package that defines a bash function. I would like to replace their bash function with an identically-named function of my own, while still being able to run their function from within mine. In other words, I need to either rename their function, or create some kind of persistent alias to it that won't be modified when I create my function of the same name.</p>
  
  <p>To give a brief example of a naive attempt that I didn't expect to work (and indeed it does not):</p>
  
  <pre><code>$ theirfunc() { echo "do their thing"; }
  $ _orig_theirfunc() { theirfunc; }
  $ theirfunc() { echo "do my thing"; _orig_theirfunc }
  $ theirfunc
  do my thing
  do my thing
  do my thing
  ...
  </code></pre>
  
  <p>Obviously I don't want infinite recursion, I want:</p>
  
  <pre><code>do my thing
  do their thing
  </code></pre>
  
  <p>How can I do this?</p>