0
$\begingroup$

Rosanswers logo

What does sourcing mean ( in simple terms ) and why are we sourcing setup.bash during installation ? [ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc source ~/.bashrc ]


Originally posted by sam26 on ROS Answers with karma: 231 on 2017-01-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

What does sourcing mean [..]

This is a rather general question. See What is the difference between “source script.sh” and “./script.sh”? on SO and Bash Prompt HOWTO - Bash Programming and Shell Scripts - Sourcing a File for some background.

why are we sourcing setup.bash during installation ?

The Environment Setup section of the installation tutorial gives a hint:

[..] the ROS environment variables are [..] added to your bash session every time a new shell is launched [..]

setup.bash (or .sh or .zsh) sets up your current command interpreter session with the configuration items necessary for ROS to function properly. In other words: it tells bash where the ROS programs and libraries are, tells Python where it can find the rospy libraries, etc.


Originally posted by gvdhoorn with karma: 86574 on 2017-01-23

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.