I would like to set a variable in a script and have it outside the script for the next command.
This is what I have:
#!/bin/bash
myExports="TEST='Value 1';export TEST;";
echo Before eval: $TEST
echo '***'
eval $myExports
echo After eval: $TEST
echo '***'
This is how i'm calling it:
./env1.sh ;echo Next command:$TEST
This is the output:
Before eval:
***
After eval: Value 1
***
Next command: