• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do shell script


  • Subject: Re: Do shell script
  • From: Stevan Reese <email@hidden>
  • Date: Wed, 25 Feb 2004 07:56:39 -0800

This is expected behavior because the "do shell script" command is using /bin/sh to execute whatever you have quoted after "do shell script".
The "\" character "escapes" the following character so that it is passes correctly. AppleScript also uses this character for the same purpose.
do shell script "\"open /Users/TripleZ/Desktop/Prog CSS/CSSEdit.app\""
should also work the same as
do shell script "open /Users/TripleZ/Desktop/Prog\ CSS/CSSEdit.app"

Sometimes you will find that you need more than one "\" because a character needs to be escaped from AppleScript and the shell at the same time.
do shell script "cat /tmp/test.txt | sed s/.*\\<//g | sed s/\\>.*//g"

regards
stevan


On Feb 25, 2004, at 7:27 AM, Gianfranco wrote:

Maybe this is a stupid question but if I use the Do shell script command with spaces in the string the command didn't work

for example

do shell script "open /Users/TripleZ/Desktop/ProgCSS/CSSEdit.app"

the script works fine if I use

do shell script "open /Users/TripleZ/Desktop/Prog\ CSS/CSSEdit.app" like in Terminal
or
do shell script "open /Users/TripleZ/Desktop/Prog CSS/CSSEdit.app"

the script didn't work any solution?

Thanks in advance.

Gianfranco
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Do shell script
      • From: Doug McNutt <email@hidden>
References: 
 >Do shell script (From: Gianfranco <email@hidden>)

  • Prev by Date: Do shell script
  • Next by Date: Re: New iTunes Track (AS DJ Script)
  • Previous by thread: Do shell script
  • Next by thread: Re: Do shell script
  • Index(es):
    • Date
    • Thread