• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Paths & quoted form & do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Paths & quoted form & do shell script


  • Subject: Re: Paths & quoted form & do shell script
  • From: "Mark J. Reed" <email@hidden>
  • Date: Sat, 8 Oct 2005 18:06:57 -0400

On 10/8/05, Martin Orpen <email@hidden> wrote:
> But, I wanted my script to check a text file that may have been written to
> disk the previous time that the script was run and grab the file path from
> that file.
>
> When I do that I get the shell choking on the path:
>
>     set tFile to (path to temporary items as string) & "PSLogTest.txt"
>     set thePath to paragraph 1 of (read file tFile)

What does thePath contain at this point?

>     do shell script "/usr/bin/grep -i saved " & quoted form of thePath


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

That looks to me like the pathname has an apostrophe in it that isn't
getting quoted properly.  I'd really need tosee what that line looks
like to diagnose the problem.

> BTW, is there an easy way of getting an *escaped form* of a POSIX path
> without having to write a handler to do it?

I don't understand the question.  You're looking for something other
than "quoted form of"?

--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Paths & quoted form & do shell script
      • From: Martin Orpen <email@hidden>
References: 
 >Paths & quoted form & do shell script (From: Martin Orpen <email@hidden>)

  • Prev by Date: Paths & quoted form & do shell script
  • Next by Date: Re: Paths & quoted form & do shell script
  • Previous by thread: Paths & quoted form & do shell script
  • Next by thread: Re: Paths & quoted form & do shell script
  • Index(es):
    • Date
    • Thread