home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!mcsun!sunic!ugle.unit.no!news
- From: Harald.Eikrem@delab.sintef.no
- Subject: Re: How to detect login shell in .cshrc ?
- In-Reply-To: ddb0248@mcnews.mcdata.com's message of 17 Aug 92 22:42:25 GMT
- Message-ID: <1992Aug25.235452*Harald.Eikrem@delab.sintef.no>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: SINTEF DELAB, Trondheim, Norway.
- References: <1992Aug17.224225.21915@mcnews.mcdata.com>
- Date: 25 Aug 92 23:54:52
- Lines: 13
-
- ! Is there a clean way in your .cshrc to determine whether it is
- ! being executed by the login shell? I have some commands that I
- ! want to execute only if this is *not* the login shell.
- !
- ! The best I could come up with is to run "ps" and count the number
- ! of lines it outputs after maybe grepping them for "csh". Really ugly.
-
- And the ugly answer is: no.
-
- In tcsh one might test $shlvl for value 1, but that will not always guarantee
- that it is a login shell.
-
- ~~harald E.
-