Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to produce the name of a machine (env doesn't help)

Status
Not open for further replies.

Donald

Programmer
Mar 13, 2000
15
CA
I need to find the name of a machine programatically, but on hp-ux, there is no reference to it. Is there some secret hp method to get a machine to cough up it's name that doesn't use env?
 
Donald -

Try the hostname command. This works in AIX, not sure about hp.

Christopher Devenny
c_devenny@yahoo.com

 
If hostname doesn't work - try uname
Mike
michael.j.lacey@ntlworld.com
 
There is a brute force method. If the machines are networked and running 10.20, you could open the file /etc/rc.config.d/netconf. In netconf is the hostname and IP address of each machine in ascii text. At least in our network it is.
 
should be

COMPUTERNAME=`uname -n`

(those quotes are actually back-ticks)
Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top