home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!munnari.oz.au!manuel.anu.edu.au!sserve!ccadfa.cc.adfa.oz.au!cjsv
- From: Christopher.Vance@adfa.oz.au (Christopher JS Vance)
- Subject: Re: .cshrc vs .login in csh
- Message-ID: <1992Dec16.223316.1021@sserve.cc.adfa.oz.au>
- Originator: cjsv@ccadfa.cc.adfa.oz.au
- Sender: news@sserve.cc.adfa.oz.au
- Organization: Computer Science, University College, UNSW/ADFA, Canberra, Australia
- References: <1992Nov30.231900.24236@informix.com> <nrp.723202569@reading> <1992Dec15.144202.14110@gmuvax2.gmu.edu>
- Date: Wed, 16 Dec 1992 22:33:16 GMT
- Lines: 30
-
- In article <1992Dec15.144202.14110@gmuvax2.gmu.edu> esaffle@gmuvax2.gmu.edu (Ed Saffle) writes:
- | Sorry to add so late to this conversation, but isn't the .login file
-
- You should have read the rest of the thread before you wrote..
-
- | only used at login time, and the .cshrc file used everytime a new shell is
- | started ( unless -f is specified)?
- | So why not put your environment setup stuff in the .login, such as path and
- | terminal stuff, then put aliases and that kind of thing in the .cshrc?
-
- Because you sometimes get a shell *without* logging in. Such a shell
- will source .cshrc but has no ancestor which has sourced .login. Like
- all my xterms, for a start. No I don't want to start all my xterm
- shells as login shells.
-
- I always set an environment variable (not a shell variable, since they
- don't propagate) which indicates whether or not my .cshrc has been
- sourced yet. My .cshrc then checks the existence or value of this
- variable to decide whether to set things like my path, etc. You can
- also check whether the shell variable, prompt, has been set to decide
- whether to do terminal setup.
-
- Currently the variable I use for this purpose is SHELL, and the value
- I look for ends with `Rc'. (It was `rc' but one vendor's /bin/sh
- thinks that the environment variable SHELL set to such a value
- indicates a restricted shell, breaking the few /bin/sh scripts I
- haven't yet converted to rc.) The [t]csh is still my login shell
- because I (infrequently) want to do job control in situations where I
- have neither X nor screen available --- it's a not-very-satisfactory-
- but-almost-passable window manager....
-