Search code examples
terminalsyntax-errorunexpected-token

error message: -bash: syntax error near unexpected token `('


I am installing software, and the last line (here is the picture of my terminal 1) delivers the message: -bash: syntax error near unexpected token `(' . I was thinking that I need to insert a backward slash somewhere in between the parentheses in the command line that gave me the error message when I ran it. However, I am skeptical of having to change anything because this line is from NASA from a tutorial to install certain software (seems pretty official). Thank you!


Solution

  • It looks like you're following the instructions at this website: https://heasarc.gsfc.nasa.gov/lheasoft/install.html

    And you've copied this command into your terminal

    gunzip -c heasoft6.26(src|arch).tar.gz | tar xf -
    

    The command isn't meant to be copied literally, the writers intend you replace the "(src|arch)" part to match the file you've downloaded.

    Check what files exist in your directory by running ls -l When you see the file you're looking for, run the command again with the correct filename.

    For example if you downloaded the pre-compiled binary for OS X, run:

    gunzip -c heasoft-6.26.1mac_intel_darwin18_patch.tar.gz | tar xf -