Xref: utzoo comp.unix.programmer:148 comp.unix.questions:25888 Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!fuug!demos!jvdrd!saukh!nms From: nms@saukh.rd.jvd.su (Nickolay Saukh) Newsgroups: comp.unix.programmer,comp.unix.questions Subject: Easy way to find hostname/domainname Message-ID: <1990Sep28.162012.14325@saukh.rd.jvd.su> Date: 28 Sep 90 16:20:12 GMT Sender: nms@saukh.rd.jvd.su (Nickolay Saukh) Organization: JV Dialogue, Moscow, USSR Lines: 25 I need advice/software to figure out the hostname & domain name for C programs and shell scripts. In C for hostname it seems to be quite easy: #if defined(BSD) gethostname(...); #endif #if defined(USG) uname(...); #endif #if defined(ANYTHING_ELSE) popen("uuname -l", ...); #endif But how to find domain name? Look at some file with magic name? What the name should be (with portabily issues in mind)? The same problem for shell scripts. I know about 'hostname' command in BSD world, 'uuname -l' for SV world (and 'uname' also). This problem is one more 'iron curtain' (-:, which separates *NIXes of the world. Help them unite!!! -- | Nickolay Saukh | nms@saukh.rd.jvd.su | ...!fuug!demos!jvdrd!saukh!nms |