• 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: read shell into property, pass to do shell script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read shell into property, pass to do shell script?


  • Subject: Re: read shell into property, pass to do shell script?
  • From: Steve Mills <email@hidden>
  • Date: Fri, 3 Oct 2003 10:10:27 -0500

On Friday, Oct 3, 2003, at 09:42 US/Central, Star wrote:

set myShellStuff to read alias myShellStuffPath from 1 to (get eof alias myShellStuffPath)
end if
set myShellStuff to myShellStuff as string

do shell script (myShellStuff & " " & ?
quoted form of POSIX path of TestFile & " " & ?
quoted form of POSIX path of LogFile)

result = sh test_file log_file

So, if I go and run this shell script from the terminal, and I
don't pass the arguments of "test_file" & "log_file" I will get
same result, or error. That's why I assumed the property
was working fine.

Could it be that the text of the shell script has carriage returns in it? From the couple tests I did, that'll screw it up.

do shell script ("ls" & return & "ls")
-->sh: ls
-->ls: command not found

Changing it to this works:

do shell script ("ls" & (ASCII character 10) & "ls")

Maybe the text of myShellStuff has a CR or LF at the end?

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
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: read shell into property, pass to do shell script?
      • From: Walter Ian Kaye <email@hidden>
  • Prev by Date: Malloc/bus error when using osascript
  • Next by Date: Re: Change the Position of an disk icon on the desktop
  • Previous by thread: read shell into property, pass to do shell script?
  • Next by thread: Re: read shell into property, pass to do shell script?
  • Index(es):
    • Date
    • Thread