how do I tell inside .cshrc if I'm a login shell?
Isaac Rabinovitch
ergo at netcom.UUCP
Sun Aug 5 02:07:27 AEST 1990
In <614 at exodus.Eng.Sun.COM> holtz at 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 at 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 at 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
More information about the Comp.unix.questions
mailing list