./foo executed foo if it is marked as an executable and has the correct shebang line (or is it an ELF binary). It will be executed in a new process.
. ./foo . ./foo or . foo . foo loads the script into the current shell. It is equal to source foo
In your code example, you need to use the second method if you want the exported variables to be available in your shell.
source share