Author Topic: "sh: -c: line 0: unexpected EOF while looking for matching `''  (Read 6253 times)

pedroparamo

  • Full Member
  • ***
  • Posts: 41
"sh: -c: line 0: unexpected EOF while looking for matching `''
« on: September 07, 2010, 04:11:09 PM »
Why does this work

do shell script "exiftool -CopyrightNotice='© Pedro Paramo, 2010' '/Users/Peter/Desktop/22222/62480-03.jpg'"

but this

do shell script "exiftool -MWG:Creator='Pedro Paramo' '/Users/Peter/Desktop/22222/62480-03.jpg'"

give me the error

"sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file" number 2


They look the same to me??

Thanks.

Pedro

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16687
    • ExifTool Home Page
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #1 on: September 07, 2010, 06:50:55 PM »
I cut and pasted these commands into the Script Editor and they both work fine (after changing the path to a file that exists).

I suggest that you have a backtick (`) instead of an apostrophe (') in your version.  This could cause the problem.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pedroparamo

  • Full Member
  • ***
  • Posts: 41
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #2 on: September 08, 2010, 09:26:43 AM »
I think you are right but how do I find the backtick and replace it with an apostrophe?

Pedro

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16687
    • ExifTool Home Page
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #3 on: September 08, 2010, 07:27:17 PM »
If you cut and paste your examples from the forum into the Script Editor, they should work.  They did for me.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16687
    • ExifTool Home Page
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #4 on: September 09, 2010, 09:59:22 AM »
Ah.  I see it isn't as simple as all that:

Apple support discussions thread

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pedroparamo

  • Full Member
  • ***
  • Posts: 41
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #5 on: September 09, 2010, 01:02:54 PM »
You are right about the backtick--it is in my variable which is created in applescript before it is passed to Exiftool.  It's cause by a space in my variable which needs to be escaped before it is passed to Exiftool.

Thanks.

Pedro

pedroparamo

  • Full Member
  • ***
  • Posts: 41
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #6 on: September 13, 2010, 09:57:17 AM »
Actually this backtick seems to be related to Photoshop.  I was experiencing a similar problem before (see previous post https://exiftool.org/forum/index.php/topic,2776.0.html).  If I open and save the files in Photoshop and then run my script everything works fine.  Perhaps I can try to find out how to write a plugin for Photoshop that you mentioned.

Thanks.

Pedro

pedroparamo

  • Full Member
  • ***
  • Posts: 41
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #7 on: September 21, 2010, 10:45:52 AM »
Anyone know where I might find information on how I would go about writing a plugin for Photoshop as a solution to this?

Thanks.

Pedro

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16687
    • ExifTool Home Page
Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
« Reply #8 on: September 21, 2010, 11:03:53 AM »
I would think you should start from the Adobe Photoshop SDK.  If it is a reasonable SDK, it should contain samples that you can build from.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).