Add the -l flag in top of your bash script i.e.
#!/usr/bin/env bash -l
...
export NAME1="VALUE1"
export NAME2="VALUE2"
The values with NAME1
and NAME2
will now have been exported to your current environment, however these changes are not permanent. If you want them to be permanent you need to add them to your .bashrc
file or other init file.
From the man pages:
-l Make bash act as if it had been invoked as a login shell (see INVOCATION below).