Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!usc!elroy.jpl.nasa.gov!ucla-cs!uci-ics!zardoz!tgate!ka3ovk!drilex!axiom!linus!nixbur!nixpbe!net4!tawab From: tawab@net4.UUCP Newsgroups: comp.unix.questions Subject: Re: How can a login script determin Message-ID: <9100004@net4> Date: 24 Jul 89 20:25:40 GMT References: <222552@<1989Jul22> Lines: 43 Nf-ID: #R:<1989Jul22:-22255200:net4:9100004:000:1329 Nf-From: net4.UUCP!tawab Jul 24 12:08:00 1989 /* ---------- "Re: How can a login script determin" ---------- */ In article <1448@tellab5.tellabs.CHI.IL.US> rtm@tellab5.UUCP (Roberto Michelassi) writes: >> >>I am currently a ksh user running on a Sun 3/60 with SunOS 4.0 and would like >>to add a feature to my .profile or .kshrc file that would update the tool >>header of the window to display the message "RLOGIN" when I remotely log into >>another machine. >Seth Robertson seth@ctr.columbia.edu writes: >Nothing easier!!! >(Of course I can't tell whether it is telnet or rlogin...) #Koments deleted >: {$tty:=`tty`} >: {$pty:=`basename $tty`} >if echo $pty | grep ttyp > /dev/null 2>&1 ## Note Yuck! Echo|grep?? >then >if basename $0 | grep -e "-ksh" > /dev/null 2>&1 ## Less yucky than before >then >echo This is a a remote session. >echo That is because is on a pseudo-terminal and was started >echo by login. \(But not necessarily a rlogin\) >fi >fi >I even tested it!!! (Wow, can get better service that that!!! :-) :-) easier than easy!!! I think /etc/realtty, will exit with 0 if a realtty, and with 1 otherwise!! :-) Robin Tawab NIXDORF COMPUTER AG Dep DTSW 2-4 Berliner Str. 95 D-8000 Munic (West Germany) Tel.: (nat-89)3601-2956 eunet: tawab.muc@nixpbe.UUCP !USA: mcvax!unido!nixpbe!tawab.muc USA: uunet!linus!nixbur!tawab.muc