Sourcing

Have you tried source toVars.sh or . /full/path/toVars.sh ?

Sourcing will define variables, functions from source file, and make it available to new processe(es) executed from your shell after the file has been sourced.

This is commonly used software installation, to maintain a definition of paths and functions requried for sofware install and/or running of e.g JAVA_HOME, TMP_DIR etc.

Hope that helps
Regards
Peasant

2 Likes