alias to source current workspace

asked 2021-09-02 12:04:31 -0500

ticotico gravatar image

Hi, I am (unfortunately) not a bash expert and would like to create an alias that sources the current workspace, i.e. do the following:

  • Situation: I am some where in ~/workspaces/ws1/src/asdf
  • I execute an alias source_curr_ws
  • the alias should go levels up until the workspace directory and source ~workspaces/ws1/devel/setup.bash

Of course, the names for workspace and ws1 should be flexible which is why I don't want to put the absolute path in the .bashrc. Thx for any pointer!

edit retag flag offensive close merge delete

Comments

So this isn't really a ROS question.

While the context is certainly ROS-related, as you already imply yourself, implementing what you describe is mostly a Bash affair.

You may get more / better / quicker responses if you post this on something like Stack Exchange.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-02 14:49:36 -0500 )edit