I was given a script to automate some processes. This script gets executed on a Mac in Terminal. The script is a bash script.

However, Terminal is showing

syntax error near unexpected token `('



What could be the issue? How can I remove the error?

  • 1
    Use strong quotes instead of week quotes? ManagerDaemon='/Library/LaunchDaemons/com.graphisoft.PortalServerService-v24.0(Manager-2020-07-21).plist'
    – fd0
    Jul 23, 2020 at 20:13
  • 1
    But remember - if you go with what @fd0 said, you can only use them "weekly" so be judicious when using! That said...parentheses just be avoided in file names altogether.
    – Allan
    Jul 23, 2020 at 20:25
  • ha! and I agree with you about the parentheses. Unfortunately, the software developer decided their filenames would have those.
    – jkershaw
    Jul 23, 2020 at 20:33
  • Are you related to Clayton?
    – Natsfan
    Jul 24, 2020 at 5:03
  • nope. nor Sammy, Doug, or Nick - the only other famous ones I'm aware of...
    – jkershaw
    Jul 24, 2020 at 23:22

2 Answers 2


ok, so I think the answer has to do with "curly" quotes or "smart" quotes as opposed to "straight" quotes.

I had been using a text editor to edit the script. However, when I switched to an actual code editor, it noticed several "curly" quotes. I replaced those with straight quotes and all is well.

  • Yes, that would do it! Good find.
    – Scot
    Jul 23, 2020 at 20:37

One possibility is the broken line. Make sure that the line looks like this in your editor (all on one line):


Rather than this (with a line break in the middle):

ManagerDaemon="/Library/LaunchDaemons/com.graphisoft.PortalServerService- v24.0(Manager-2020-07-21).plist"

  • Editor must be warping the view, without inserting the new line characters. It'd be bad for an editor to do the latter
    – anki
    Jul 23, 2020 at 22:08

You must log in to answer this question.

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