OSX local host name...

Jim jimc at ace-pb.com
Thu Apr 29 18:27:07 EDT 2004


On Apr 29, 2004, at 5:04 PM, Chipp Walters wrote:

> Is there a way to get the local host name of an OSX machine when it's 
> assigned IP's dynamically?
>
> hostName() doesn't work
>
> In particular, I'm looking for a shell command that might return it. 
> Thx!
>

get shell("ipconfig getifaddr en0") will get your ethernet IP
get shell("ipconfig getifaddr en1") will get your Airport (if you have 
a card) IP

You'll have to dig the name out of the reply, but you can

get shell("nslookup [[ipAddress]]") to get any host name that DNS can 
resolve. Look for "name = xxx.yyy.zzz" in the long reply.

JIm



More information about the use-livecode mailing list