Unable to install - Illegal variable name

(Warlock777) #1

When I run the /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” command I get back the following error: “Illegal variable name.”

Does anybody have any ideas about how to fix this?

(Mike McQuaid) #2

What version of macOS are you running? Can you paste the full input/output? Thanks.

(Warlock777) #3

Here’s the Terminal input and output:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Illegal variable name.

I’m running OS X 10.11.6

(Mike McQuaid) #4

Sorry, I can’t reproduce. You may want to download that page manually and check you can access it.

(Warlock777) #5

I’ve pulled the master install file and placed it in a text file and I get the same error. Something in the file appears to conflict with what’s allowed. I wish it would tell me which variable name was at issue.

(Mike McQuaid) #6

What does $(which curl) --version and /usr/bin/ruby --version output?

(Warlock777) #7

$(which curl) --version
Illegal variable name.

/usr/bin/ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

It’s the curl!

(Warlock777) #8

which curl

which curl --version
–version: Command not found.

I’m not very familiar with curl…

(Mike McQuaid) #9

What about file /usr/bin/curl and ls -lha /usr/bin/curl?

(Warlock777) #10

file /usr/bin/curl
/usr/bin/curl: Mach-O 64-bit executable x86_64

ls -lha /usr/bin/curl
-rwxr-xr-x 1 root wheel 168K Dec 3 2015 /usr/bin/curl

(Warlock777) #11

By the way, thanks for your help Mike.

(Mike McQuaid) #12

My pleasure. What does ls -lha ~/ | grep -i curl and env | grep -i curl output?

(Warlock777) #13

ls -lha ~/ | grep -i curl
returns nothing

env | grep -i curl
returns nothing

(Mike McQuaid) #14

I’m afraid I have no idea what’s going on, there’s something seriously wrong with either your personal configuration and/or your curl. You may want to try to run this as a new, unconfigured admin user and/or reinstall macOS.

(Warlock777) #15

If I do the version check on the curl in /usr/bin directly (without the $ notation) I get the following:

/usr/bin/curl --version
curl 7.43.0 (x86_64-apple-darwin15.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets

(Mike McQuaid) #16

What shell are you using? echo $SHELL

(Warlock777) #17

echo $SHELL

(Warlock777) #18

I don’t see curl referenced in env

(Mike McQuaid) #19

Yes, that’s why it won’t work. You need to use Bash or ZSH to copy-paste that install command. If you can’t figure out these type of things by yourself you probably shouldn’t be using tcsh (or at least not asking for help when things in your shell don’t work).

(Warlock777) #20

Changing to bash got it working.

In my Terminal preferences pane it’s set to use the ‘Default login shell’ which was tcsh when I started using OS X…

bash has only been the default shell since 10.3 (2005), I’ve been running OS X since the public beta (2000). tcsh was the default shell for 10.0, 10.1 and 10.2.

Thanks for your help. OS X has always allowed us to import our old settings (even when moving from PowerPC to Intel processors), so it must be a carryover from back before 2005 as I have never altered my Terminal preferences.