What does source command actually do?
Hi, I've read that $ source devel/setup.bash is the same as $ .devel/setup.bash and that it reads and executes setup.bash script in the current shell. Opposite to this $ ./devel/setup.bash what would run the same script but launching new shell.
So we want to run $ source <filename> command everytime we open new terminal.
Following questions are:
- Its not clear to me what actually am I doing with the source command. Where can I find this bash file that contains these enviroment variables, so I can track what's going on?
- Can I permanently add required enviromental variables so I don't have to do it manually every time I open a terminal? What are pros and cons of doing such.
- I followed tutorial. Entered this:
$ source devel/setup.bash
$ echo $ROS_PACKAGE_PATH
Which gave me:
/home/username/Workspace/ros-workspace/tutorial_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
Then I entered this:
$ source /opt/ros/indigo/setup.bash
$ echo $ROS_PACKAGE_PATH
Which gave me:
/opt/ros/indigo/share:/opt/ros/indigo/stacks
Why such sequence erased my ~/home... path from bash??