Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!yale!cs.yale.edu!Anselmo-Ed From: Anselmo-Ed@cs.yale.edu (Ed Anselmo) Newsgroups: comp.unix.questions Subject: Re: Finding your remote host's name Message-ID: Date: 7 Jun 90 20:40:48 GMT References: <1990Jun6.091842.11335@dlcq15.datlog.co.uk> <1211@tuewsd.win.tue.nl> <17060@phoenix.Princeton.EDU> Sender: news@cs.yale.edu Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Lines: 17 In-reply-to: subbarao@phoenix.Princeton.EDU's message of 7 Jun 90 18:21:12 GMT >>>>> On 7 Jun 90 18:21:12 GMT, subbarao@phoenix.Princeton.EDU (Kartik Subbarao) said: Kartik> YOW! I don't see at all why it has to be that complicated. We can just Kartik> do this: Kartik> set from = `who am i | cut -d'(' -f2 | cut -d')' -f1` Kartik> and do with $from as we wish. This certainly doesn't work with all versions of "who" (I just tried it on a Sun, a Xenix machine, an ATT unix/386 machine, something running mach, and an apollo). Some versions of "who am i" show the machine name, some don't. Even on the ones that do show the machine name, the name is typically trucated to 16 or so characters, e.g "bigbird.cf.cs.ya" instead of "bigbird.cf.cs.yale.edu". -- Ed Anselmo anselmo-ed@cs.yale.edu {harvard,decvax}!yale!anselmo-ed