• 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: Christopher Nebel <email@hidden>
  • Date: Mon, 8 Jul 2002 12:28:08 -0700

Resending this to the list, since I read Steven's private email first...

On Sunday, July 7, 2002, at 04:06 AM, Steven Angier wrote:

I am having trouble with a particular "do shell script" command. This command sends the start command to the FileMaker Server daemon. The problem is that the script hangs until the server is stopped. ... This might make more sense if this "fmserverd" process belonged to a shell
window, like top or ping, but it does not. I am able to run the start command from the terminal and continue to use that terminal window for other things.

"do shell script" is defined to wait until the command you give it completes, or more precisely, returns EOF from its stdout and stderr. The fact that fmserverd apparently daemonizes itself when run from a terminal session but *not* from "do shell script" is a little peculiar, I'll admit -- I'll have to do some checking there.

In any case, there is a standard way to run a "do shell script" command detached, so "do shell script" returns immediately and the command proceeds on its merry way:

do shell script "put_command_here > /dev/null 2>&1 &"

The "/dev/null" can actually be any file, but the output from daemons typically isn't interesting. This question comes up about every month or two on one of the AppleScript lists -- I've really got to get that "do shell script" FAQ published.


--Chris Nebel
AppleScript Engineering
_______________________________________________
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: Steven Angier <email@hidden>
  • Prev by Date: Re: Two questions
  • Next by Date: Re: Two questions
  • Previous by thread: Re: do shell script
  • Next by thread: Re: do shell script
  • Index(es):
    • Date
    • Thread