Ask Your Question
0

Question about "./devel/setup.bash" while sourcing setup.bash

asked 2020-01-01 22:46:27 -0500

humpback gravatar image

updated 2020-01-02 10:47:30 -0500

gvdhoorn gravatar image

Normally i source my environment with "source /devel/setup.bash" but i noticed in the tutorial that there is a period before the file location "source ./devel/setup.bash" Why is that period there?

p.s. This is my first post so im not sure where to really ask this question.


Edit:

This is the tutorial I was following: http://wiki.ros.org/ROS/Tutorials/Exa...

# In your catkin workspace
$ cd ~/catkin_ws
$ source ./devel/SETUP.BASH
edit retag flag offensive close merge delete

Comments

Could you please link to "the tutorial" you refer to in your question text?

Perhaps even include a quote of the section you mention has the dot in it.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-02 09:31:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-01-02 03:30:16 -0500

gvdhoorn gravatar image

Normally i source my environment with "source /devel/setup.bash" but i noticed in the tutorial that there is a period before the file location "source ./devel/setup.bash" Why is that period there?

A . (dot) in a path refers to the "current directory".

It makes whatever path comes after the dot relative to the current directory.

So source ./devel/setup.bash sources the file setup.bash in a directory called devel that must be in the current directory.

However, all paths not starting with a / are relative to the current working directory, so the dot is not actually necessary here.

This is my first post so im not sure where to really ask this question.

In the end this is not really a ROS question (more a general Linux one), but given the context it's fine.

edit flag offensive delete link more

Comments

If you want to know more about this, you could Google for something like linux current directory dot).

gvdhoorn gravatar image gvdhoorn  ( 2020-01-02 03:32:16 -0500 )edit

Wow, thank you for the quick response. Very well written.

humpback gravatar image humpback  ( 2020-01-02 08:57:46 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-01-01 22:46:27 -0500

Seen: 35 times

Last updated: Jan 02