Source files in a bash script.
I am using two versions of ROS next to each other. To use one I have to source some enviroment variables for the specific version. I would like to create a script that does this. But if I create a script like below the variables are not set, they are probably set in a subshell. How can I source the files to the main terminal shell?
source /opt/ros/fuerte/setup.bash; source ~/fuerte_workspace/setup.bash;
Execute Shell Script Using . ./ (dot space dot slash)
While executing the shell script using “dot space dot slash”, as shown below, it will execute the script in the current shell without forking a sub shell.
$ . ./setup.bash
In other words, this executes the commands specified in the setup.bash in the current shell, and prepares the environment for you.