GETTING HOSTNAME FROM UTMP

Michiel Wories michiel at baan.UUCP
Wed Jan 30 23:35:19 AEST 1991


Howdy folks,

Does anybody know a standard way to retrieve the hostname from /etc/utmp
or getting this hostname any other standard way?
It should work for UNIX V.2 through UNIX V.4 and BSD (...).
I am aware of the fact /etc/utmp hasn't always a ut_host member in
its structure.

NOTE: who gives this output:
michiel    ttyp0        Jan 30 10:33  (bv8c55.baan.nl)
I'm interested in this entry ----------^

Many thanks,

--------------------------------------------------------
Michiel Wories @ Baan International, The Netherlands
..!hp4nl!baan!michiel



More information about the Comp.unix.wizards mailing list