Xref: utzoo comp.unix.questions:28311 comp.unix.wizards:23919 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!baan!michiel From: michiel@baan.UUCP (Michiel Wories) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: GETTING HOSTNAME FROM UTMP Keywords: UTMP WHO HOSTNAME Message-ID: <995@baan.UUCP> Date: 30 Jan 91 12:35:19 GMT Organization: Baan International Lines: 17 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