Search code examples
curlfreebsdcsh

freebsd: Illegal variable name


I am trying to run the following command:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

but getting:

Illegal variable name.

How to fix it?


Solution

  • First never run script downloaded like that. You never know what it is going to execute on your system.

    • First download the script with:
      curl -O https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
    • Then run the script with ksh or bash:
      bash install.sh

    I checked this install script code and it is not passing shellcheck.net static analysis. So its authors have more homework to do.