title: Calling a nested function in xargs (on MacOS)
body: <p>I have the following setup:</p>
  
  <pre><code>#!/bin/bash
  
  function outer() {
    function inner() {
      ...
    }
  
    ... | xargs -L1 inner
  
  }
  </code></pre>
  
  <p>So, I want to call <code>inner</code> for each of the lines that are generated in <code>outer</code> and call the function from an interactive shell. How would I do that?</p>
  
  <p>I've tried exporting the <code>inner</code> function (from within <code>outer</code>) but that has no effect as I get 'no such file or directory'.</p>
  
  <p>Note that <code>inner</code> calls <code>xargs</code> too, so for each output piped from <code>outer</code> to <code>inner</code> there will multiple executions (in case that makes a difference).</p>