title: Bash variable that outlives the shell script
body: <p>We have an issue that I am able to recreate with this simple example.  I have the following sample shell script file, named <code>SO-shell.txt</code></p>
  <pre><code>#!/bin/bash
  export my_var=&quot;A quick bown fox&quot;
  echo my_var was set to &quot;$my_var&quot;
  </code></pre>
  <p>When I run <code>SO-shell.txt</code> I get the following output:<br />
  <code>my_var was set to A quick bown fox</code></p>
  <p>After the script has finished execution, if I execute the following at the shell command line:<br />
  <code>shell&gt; echo &quot;$my_var&quot;</code></p>
  <p>I don't see anything (i.e. shell variable did not get assigned beyond the lifespan of the shell script)</p>
  <hr />
  <p><strong>Q)</strong> How to make a shell variable outlive the lifespan of its defining shell script?</p>