3

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 `('

in

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

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

5
  • 1
    Use strong quotes instead of week quotes? ManagerDaemon='/Library/LaunchDaemons/com.graphisoft.PortalServerService-v24.0(Manager-2020-07-21).plist'
    – fd0
    Commented 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
    Commented 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
    Commented Jul 23, 2020 at 20:33
  • Are you related to Clayton?
    – Natsfan
    Commented Jul 24, 2020 at 5:03
  • nope. nor Sammy, Doug, or Nick - the only other famous ones I'm aware of...
    – jkershaw
    Commented Jul 24, 2020 at 23:22

2 Answers 2

4

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.

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

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

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

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

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

1
  • Editor must be warping the view, without inserting the new line characters. It'd be bad for an editor to do the latter
    – anki
    Commented 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 .