Sooner or later, I will…
Posts tagged bash
Enable export of all environment variables in bash
4 years
When setting up environment variables, for example in .profile you can write the following near the top of the file to enable exporting of all the environment variables without explicitly writing “export” each time:
set -o allexport
with the above, then you can just write the following, for example:
TEST_DIR=/tmp/test
instead of
export TEST_DIR=/tmp/test
To disable the all export:
set +o allexport
You are also able to set environment variables without the export or allexport, however that will NOT make the variable available to sub-processes.
Recent Comments