http://qs321.pair.com?node_id=1160547


in reply to keeping something in memory after the end of script

If the "Next run" is started from the same shell, or a child of that shell, you could use "export"ed environment variables to persist data, as suggested here.

        This is not an optical illusion, it just looks like one.

  • Comment on Re: keeping something in memory after the end of script

Replies are listed 'Best First'.
Re^2: keeping something in memory after the end of script
by fullermd (Priest) on Apr 15, 2016 at 18:38 UTC

    Not really (at least, not without some sort of nutso magic trick). The shell would be the parent process of your script; you can't mess with your parent's environment.

      Point taken (++), but the magic is not too achene:
      ~$ chksum=$(perl -e'print qq|Set by perl|'); echo BASH says chksum is +$chksum BASH says chksum is Set by perl

              This is not an optical illusion, it just looks like one.