Nearly: bash spawn expect and dns-sd

David Bovill david at vaudevillecourt.tv
Fri Jan 28 12:58:20 EST 2011


Not quite able to get this cross platform command line to work for Bonjour -
it hangs around waiting for input. I've tried open process and that nearly
works, but think this is the way to go:

set expectCode to "
> spawn -noecho dns-sd -B _ssh._tcp
> expect -timeout 5 eof {}
> "
> do shell script "echo " & quoted form of expectCode & "|/usr/bin/expect -f
> -"
>

It's an AppleScript... but I'm not quite getting it. This is what I want to
do:

   1. Register a service - "dns-sd -R 'LiveCode Port Mapper' _livecode._udp.
   . 45000 pdl=application/livecode" does this on the command line but waits
   around
   2. List services available - "dns-sd -L 'LiveCode Port Mapper'
   _livecode._udp. ." does this on the command line

But I want to use LiveCode's shell (or open process) for this - any ideas?



More information about the use-livecode mailing list