| |||
Environment variables can only be set in the current process and exported downwards to child processes, not upwards to parent processes. Your shell script is a subprocess of the interactive shell. When your shell script ends, so does the scope of the environment variables. If you want a short cut to set the variables, then it has to be run in the current shell. Which means you have to source the script rather than run it as a child. The syntax is: . script That's a dot in the first column. It means read this file and run it as if I had typed the lines to this interactive shell. |
Bash Environment Variables
No TrackBacks
TrackBack URL: http://writch.com/mt/mt-tb.cgi/496
Leave a comment