I am looking for the name of my MAC machine to possibly use in a script. On Thu, Oct 20, 2011 at 12:47 PM, Chuck van der Linden <[email protected]>wrote:
> On Oct 20, 7:47 am, Joe Fl <[email protected]> wrote: > > Hi, > > > > This is a ruby question but how do I get the name of my MAC using > > ruby. > > > > I have found: > > > > require 'socket' > > puts Socket.gethostname > > > > (not what I am looking for) > > > > puts ENV["COMPUTERNAME"] > > > > puts ENV['USERDOMAIN'] > > puts ENV['LOGONSERVER'] > > > > they all return nil > > > > I don't know if any of those are set (surely I doubt 'domain' or > 'loginserver' since I think those are unique to a system that is > logging into a windows domain or active-directory.) > > You might try HOSTNAME > > Are you looking for the name set for the system under networking > settings on the WINS tab, or under sharing settings for Bonjour? or > set somewhere else? > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected] > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
