ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

source command not found

asked 2011-12-14 06:19:42 -0600

rimzahir gravatar image

Hello, I'm trying to install ros on my ubuntu 11.10 and get it work. I followed successfully the tutorial here http://www.ros.org/wiki/electric/Installation/Ubuntu and I'm attempting to the following one here : http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment. According to the second instruction I went to setup.sh which is in /opt/ros/electric/ and modified it according to the script written in that page. But when I run source setup.sh, I get the error " /opt/ros/electric/setup.sh: 2: source: not found " .I tried to change #!/bin/sh by #!/bin/bash in the beginning of the setup.sh and ran bash /opt/ros/electric/setup.sh but I'm still getting the same error

Thank you in advance for your help

Rim Zahir

edit retag flag offensive close merge delete

Comments

It would probably help if you posted your edited setup.sh file. Perhaps somewhere like http://beta.pastee.com .
Murph gravatar image Murph  ( 2011-12-14 06:27:04 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-12-14 06:57:19 -0600

karthik gravatar image

Hi, According to http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment you are not supposed to edit the setup.sh file in the "/opt/ros/electric/" path but setup in your ros_workspace folder created by you. The idea behind setting up the workspace is to have the packages fetched by ros automatically. Once you download or create a package in this workspace in the future, the ros commands like roscd, rosmake, rosed etc would be able to lookup in this path. Once you setup the environment/workspace, your

echo $ROS_PACKAGE_PATH

would give the following output

/home/user/ros_workspace:/opt/ros/electric/stacks

You have to source this path to your ~/.bashrc file so that it gets picked up every time you run the terminal.

Hope this helps, Karthik

edit flag offensive delete link more

Comments

Thank you for answering that quickly. I set the setup.sh file back as it was (i changed only the first line so it was easy). You said that I have to setup setup.sh in ros_worspace, does that mean I have to create the setup.sh with the script provided in the website in ros_workspace?
rimzahir gravatar image rimzahir  ( 2011-12-14 07:23:15 -0600 )edit
yes just follow the tutorial. replace ~/ros_workspace this with your own workspace path in all the places.
karthik gravatar image karthik  ( 2011-12-14 07:50:02 -0600 )edit
Thanks for your help
rimzahir gravatar image rimzahir  ( 2011-12-22 12:25:00 -0600 )edit

Question Tools

Stats

Asked: 2011-12-14 06:19:42 -0600

Seen: 3,257 times

Last updated: Dec 14 '11