For environment variables to be visible from within a bash script, you must export
them.
Given the bash script:
#!/bin/bash
echo $myvar
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 )