I tried to install homebrew (OSX 10.9.5) using the recommended

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

but got

Illegal variable name.

I do have macports installed, so perhaps some commands do not what they are meant to?? But note that ruby is /usr/bin/ruby and curl is /usr/bin/curl.

How can I overcome this problem?

3 Answers 3


The problem lies with usage of tcsh as underlying shell. tcsh does not support $() as a syntax for command substituion. When using bash instead, it works just fine.


in terminal preferences, change /bin/tcsh to /bin/bash

  • Presumably the OP is using tcsh because they want to use it in preference to bash! They don't need to (semi)permanently change their shell - just drop into bash to install brew, then exit bash and return to tcsh. And that'll work even if they're using iTerm2, or another terminal emulator, not just Terminal.app.
    – John N
    Dec 9, 2016 at 10:03

in terminal just type 'bash' and then enter now run the same command. I works fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .