For environment variables to be visible from within a bash script, you must
Given the bash script:
The environment variable
myvar must be set this way:
$ myvar="test"; # This won't work.
$ export myvar="test"; # This works.
Another solution would be to source another script where those variables are defined.
You may source in a sub-shell in order to limit the scope of the variables:
( . ./all_my_variables.sh )