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

Re: Do shell script question - timeouts


  • Subject: Re: Do shell script question - timeouts
  • From: Doug McNutt <email@hidden>
  • Date: Sun, 01 Apr 2012 12:34:46 -0600

At 12:34 -0400 4/1/12, Alex Zavatone wrote:
>Hi.  I was thinking of writing a quick automatic file sharer by detecting all the local machines on a network and setting up a share on each.
>
>To do this, I was trying this:
>
>set myShellString to "mdns -B _afpovertcp._tcp. local > ~/AFP.txt 2>&1"
>do shell script myShellString
>
>set myShellString to "killall mDNS"
>do shell script myShellString
>
>But the shell command mdns doesn't stop, so the execution doesn't proceed past the first shell script, so I tried this:
>
>on main()
>	try
>		with timeout of 1 second
>			set myShellString to "mdns -B _afpovertcp._tcp. local > ~/AFP.txt 2>&1"
>			do shell script myShellString
>		end timeout
>	end try
>
>	set myShellString to "killall mDNS"
>	do shell script myShellString
>end main
>
>
>But that seems sort of lame, almost like a cop out.  Is there is a preferred method to say to the shell to run for a while, to not wait for a response, or is this the way to do it?


The redirection of both stdout and stderr you're calling for results in no information returning to AppleScript.

I would hope that a child-died signal would tell the script to proceed but I wonder??
What shows up in APF.txt?



--

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Do shell script question - timeouts
      • From: Alex Zavatone <email@hidden>
    • Re: Do shell script question - timeouts
      • From: Alex Zavatone <email@hidden>
References: 
 >Do shell script question - timeouts (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Do shell script question - timeouts
  • Next by Date: Re: Do shell script question - timeouts
  • Previous by thread: Do shell script question - timeouts
  • Next by thread: Re: Do shell script question - timeouts
  • Index(es):
    • Date
    • Thread