title: Sharing a writable variable between bash scripts
body: <p>Using <code>bash</code> on Linux.</p>
  
  <p>I'm running <code>find</code> piped into <code>xargs</code> which launches a second bash script to do some processing on each file. I would like to maintain a "running tally" of file sizes and how many errors are encountered by the second script. In other words, every time the second script runs, it calculates the file size and adds it to the total so far, and also same thing if it encounters an error in its processing of the file. And I need this information to be available to the parent script after the <code>find | xargs</code> finishes. </p>
  
  <p>I can do this by having the second script save and update a text file &mdash; a crude way to maintain a "global variable" &mdash; but I'm wondering if there's a nicer, more efficient way. </p>