Skip to main content
1 of 2
Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129

An environment variable is not meant to do such a trick. The script inherits the environment as a copy once it is run; the two environments are then independent.

You may need to look for interprocess communication methods. If you really, really have to do this via variable, check this; although it's not the right way to communicate with a running process in normal usage.

Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129