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