I'm installing some software on a Solaris 10 machine, and the instructions mentioned 'Sourcing" a script. I've never heard of that, looked around an it appears to be something that is done at startup maybe? Is that right? Anyway, The instruction is below- and I have no idea what do with it. Could someone please help? man source gave me some ideas but I don't think it worked. I tried sh torVars.sh and exec torVars.sh-
Before you run Tornado, you need to set several environment variables. You can
do so most easily by changing directory to installDir/host/sun4-solaris2/bin,
and then sourcing torVars.csh or torVars.sh—depending on the shell you use. If
you use another shell, these scripts contain all the information you need to set the
appropriate variables.
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.
You really need to source the script with one of the syntax given by Peasant (for the second syntax, don't forget the space between the dot and the path to the script) and not simply execute the script.
In case of simple execution, the script is executed in a new process (called subshell) and all variable declarations are defined only in this subshell. Then these variables are not available for other scripts.