Can a shell script set environment variables of the calling shell? [duplicate]
Use the “dot space script” calling syntax. For example, here’s how to do it using the full path to a script: . /path/to/set_env_vars.sh And here’s how to do it if you’re in the same directory as the script: . set_env_vars.sh These execute the script under the current shell instead of loading another one (which is … Read more