Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!mcnc!duke!juliet!khera From: khera@juliet.cs.duke.edu (Vick Khera) Newsgroups: comp.unix.questions Subject: Re: how can .cshrc know if session is a login? Keywords: csh login .cshrc Message-ID: <14551@duke.cs.duke.edu> Date: 20 May 89 15:24:03 GMT References: <434ccc08.bea3@mach1.engin.umich.edu> Sender: news@duke.cs.duke.edu Reply-To: khera@cs.duke.edu (Vick Khera) Distribution: na Organization: Duke University CS Dept.; Durham, NC Lines: 15 In article <434ccc08.bea3@mach1.engin.umich.edu> brian@caen.engin.umich.edu (Brian Holtz) writes: >Howw can .cshrc know if a session is a login session? A simple way I do this is to test for the existence of an environment variable that gets set in .login such as NAME. if it exists, then it is most likely a sub-shell, otherwise, .login has not been executed yet, so it should be a login shell. This has worked for me so far under SunOS 3.x and 4.0. vick. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ARPA: khera@cs.duke.edu Department of Computer Science CSNET: khera@duke Duke University UUCP: {mcnc,decvax}!duke!khera Durham, NC 27706