0
$\begingroup$

Rosanswers logo

I'm running Ubuntu 22.04 on my desktop computer (9th gen intel i5 processor, nvidia gtx 1080 gpu). I followed the instructions to install the Ros 2 Rolling Ubuntu binaries for my system (from this page: https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html). I made it to the Environment setup section. After running source /opt/ros/rolling/setup.bash I got the following errors:

bash: setup.sh: line 59: syntax error near unexpected token }'

bash: setup.sh: line 59: }'

I tried reinstalling everything from the binaries again, restarting my system, and inspecting the setup.sh file but was unable to find out what was happening. It doesn't help that I am not very familiar with these kinds of more complicated shell scripts.

In case it matters, here is my setup.sh (sorry for pastebin link, not sure how to do a code block here): https://pastebin.com/Dr5efb3P


Originally posted by piperdaniel1 on ROS Answers with karma: 16 on 2022-10-20

Post score: 0


Original comments

Comment by ravijoshi on 2022-10-21:
I am not sure why source /opt/ros/rolling/setup.bash is failing. However, instead of Rolling, can you please try Humble Hawksbill? BTW, which shell are you using? Here is my system:

$ echo "$SHELL"
/bin/bash

Comment by piperdaniel1 on 2022-10-22:
Thanks for your help! Luckily I figured out the issue.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Alright, I figured it out.

I aliased the word "done" in my .bashrc to a command. As I am not familiar with bash scripting I was not aware that this is a control word in bash. Anyway, there are no warnings when you do this, bash just switches out all of the "done" lines in bash scripts for whatever you aliased. This caused the syntax error to occur, because bash was expecting a for loop to be closed with a done. It reached the bracket before it saw a done (because of the alias) and therefore had an error.


Originally posted by piperdaniel1 with karma: 16 on 2022-10-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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