Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!sdd.hp.com!ucsd!pacbell.com!tandem!netcom!ergo From: ergo@netcom.UUCP (Isaac Rabinovitch) Newsgroups: comp.unix.questions Subject: Re: how do I tell inside .cshrc if I'm a login shell? Message-ID: <11413@netcom.UUCP> Date: 4 Aug 90 16:07:27 GMT References: <614@exodus.Eng.Sun.COM> Organization: UESPA Lines: 33 In <614@exodus.Eng.Sun.COM> holtz@strawdog.Eng.Sun.COM (Brian Holtz) writes: >how do I tell inside .cshrc if I'm a login shell? >It's not on the frequently-asked questions list, but maybe it ought to be. >-- >Brian Holtz (holtz@netcord.Eng.Sun.COM) Why do you need to? You can put login-specific commands in your .login. Perhaps the question I'm reading is not quite the question you meant to ask. (Nitpicking is one of my more obnoxious habits, but in this case it's the right thing to do.) Maybe you meant, "how do I tell if I'm executing the shell I get when I login instead of a shell script." If so, what you *should* ask is "how do I tell if the shell's interactive". The answer to that is, check to see if the shell has set the prompt variable. For example: if ($?prompt) .... Obviously, if you define your own prompt variable (which is probably why you're asking this question in the first place; that's why *I* did) you want to put the "if ($?prompt)" statement before the "set prompt=" statement. -- ergo@netcom.uucp Isaac Rabinovitch atina!pyramid!apple!netcom!ergo Silicon Valley, CA uunet!mimsy!ames!claris!netcom!ergo "I hate quotations. Tell me what you know!" -- Ralph Waldo Emerson