• 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: Do shell script vs terminal discrepancy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do shell script vs terminal discrepancy


  • Subject: Re: Do shell script vs terminal discrepancy
  • From: Doug McNutt <email@hidden>
  • Date: Thu, 3 Dec 2009 14:31:28 -0700

At 16:07 -0500 12/3/09, Paul Skinner wrote:
>Hi,
>
>	I have a do shell script command that is returning "" while the same  command, when run in the terminal, returns a value.
>
>In applescript:
>set ssc to "convert " & quoted form of POSIX path of thumbPath & "  - scale 3x3\\! -compress none -depth 8 ppm:- |    sed '/^#/d' | tail -n  +4"
>ssc
>-->"convert '/Users/paul/Pictures/iPhoto Library/Data/2009/textures/ b6leather_skin015.jpg'  -scale 3x3\! -compress none -depth 8 ppm:-  |    sed '/^#/d' | tail -n +4"
>set d to do shell script ssc
>-->""
>
>in Terminal:
>>convert '/Users/paul/Pictures/iPhoto Library/Data/2009/textures/ b6leather_skin015.jpg'  -scale 3x3\! -compress none -depth 8 ppm:-  |    sed '/^#/d' | tail -n +4
>-->255 207 55 25 210 60 28 202 55 25 209 57 26 212 61 29 203 57 27 204  55 25 206 59 29 194 53 24
>
>Does anyone know why I'm seeing this discrepancy in behavior?


scale 3x3\\!   in set ssc line is dangerous. AppleScript and shell are mucking with the same escape character and you may need three backslashes.

quoted form of 3x3\!  -- perhaps.

I'd also worry a bit about the pipe symbols. They just might be getting passed as unicode.

quoted form of the complete line after the POSIX path perhaps. but don't lose a space after or before the path.
--

--> From the U S of A, the only socialist country that refuses to admit it. <--
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Do shell script vs terminal discrepancy (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: iCal Recurring events
  • Next by Date: [ann] py-appscript 0.21.0
  • Previous by thread: Do shell script vs terminal discrepancy
  • Next by thread: Re: Do shell script vs terminal discrepancy
  • Index(es):
    • Date
    • Thread