setup.bash error on OSX
I just reinstalled Groovy on OSX 10.8.4 using Homebrew. I moved my old ROS directory from /opt/ros to /opt/ros_old so this is a completely new install. Now when I do:
source /opt/ros/groovy/setup.bash
I get the following error:
[kevin@tardis ~]$ source /opt/ros/groovy/setup.bash
-bash: /opt/ros/groovy/etc/catkin/profile.d/05.catkin_make.bash: line 32: syntax error in conditional expression: unexpected token `('
-bash: /opt/ros/groovy/etc/catkin/profile.d/05.catkin_make.bash: line 32: syntax error near `-@(C'
-bash: /opt/ros/groovy/etc/catkin/profile.d/05.catkin_make.bash: line 32: ` if [[ ${words[i]} == -@(C|-directory) ]]; then'
-bash: /opt/ros/groovy/etc/catkin/profile.d/05.catkin_make_isolated.bash: line 30: syntax error in conditional expression: unexpected token `('
-bash: /opt/ros/groovy/etc/catkin/profile.d/05.catkin_make_isolated.bash: line 30: syntax error near `-@(C'
-bash: /opt/ros/groovy/etc/catkin/profile.d/05.catkin_make_isolated.bash: line 30: ` if [[ ${words[i]} == -@(C|-directory) ]]; then'
Any idea what is wrong? Things worked before with Groovy. I am using:
[kevin@tardis ~]$ bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)
Copyright (C) 2007 Free Software Foundation, Inc.
The two environment hooks 05.catkin_make(_isolated).bash have been recently added to catkin to provide auto completion on these two scripts. The issue seems to be specific to OS X or your setup. On Ubuntu it works as expected. Can you try looking what in these files bothers your version of bash?
I have this version of bash:
∫ bash --version GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12) Copyright (C) 2007 Free Software Foundation, Inc.
I can source the
setup.bash
with no problems, but I cannot use the autocompletion, I get:bash: _init_completion: command not found
Can you try to replace
${#words[
with${#COMP_WORDS[
(twice) and${words[
with${COMP_WORDS[
(four times) and see if that solves your problem?Tried that, it didn't help.
If you could come up with some kind of version check we could make that part of the completion optional. But without being able to reproduce it I can't help much with that.
why don't you just implement the solution below? The issue is really simple and involves expanding the
or
statement to look at--directory
and-C
instead of the original compound statement. I am not a bash guru, but I believe my solution is correct.