Apply Environment Variables Immediately in Shell
You can use the export command to set environment variables in a shell, for example:
export MY_VARIABLE=value
To make environment variables take effect immediately, you can use the following command:
source ~/.bashrc
This will reload the configuration file of the current shell (usually .bashrc or .bash_profile), allowing any newly set environment variables to take effect immediately.