Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!uwm.edu!rutgers!mcnc!duke!macbeth!khera From: khera@macbeth.cs.duke.edu (Vick Khera) Newsgroups: comp.unix.questions Subject: Re: Login shell? Message-ID: <16412@duke.cs.duke.edu> Date: 10 Dec 89 02:59:40 GMT References: <2975@usceast.UUCP> Sender: news@duke.cs.duke.edu Reply-To: khera@cs.duke.edu (Vick Khera) Distribution: usa Organization: Duke University CS Dept.; Durham, NC Lines: 16 In article <2975@usceast.UUCP> sridhar@usceast.uucp.UUCP (M. A. Sridhar) writes: >Is there any way to determine, within a shell script (csh), whether the script >is being executed by the login shell? I know that one can use the fact that >$prompt is set to detect an interactive shell, but I don't know how to test >whether it's the login shell. the trick i use is to check for the existence of a particular environment variable (such as NAME) that i set in my .login file, since it is run after the .cshrc file is. if this variable is set, then most likely the shell is not a login shell, otherwise i assume it is. v. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vick Khera Department of Computer Science ARPA: khera@cs.duke.edu Duke University UUCP: ..!{mcnc,decvax}!duke!khera Durham, NC 27706