home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / shell / 5093 < prev    next >
Encoding:
Text File  |  1992-12-16  |  2.1 KB  |  43 lines

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