Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.unix.questions Subject: Re: How to get the pathname of the current executable? Message-ID: <1990Feb13.181022.24742@smsc.sony.com> Date: 13 Feb 90 18:10:22 GMT References: <1610.25d028a3@wums.wustl.edu> <1990Feb7.211538.3894@iwarp.intel.com> <5378@buengc.BU.EDU> <1990Feb13.095913.29040@hayes.fai.alaska.edu> Reply-To: dce@Sony.COM (David Elliott) Organization: Sony Microsystems Corp. Lines: 31 In article <1990Feb13.095913.29040@hayes.fai.alaska.edu> wisner@hayes.fai.alaska.edu (Bill Wisner) writes: >In article <5378@buengc.BU.EDU>, bph@buengc (Blair P. Houghton) writes: >> (someone please tell me >>why which(1) reads the .cshrc...) > >Because which(1) is a csh script. Chuckle. Pretty good. I don't think that's what Blair was asking. Obviously he knows it's a csh script, since it would be hard for him to know that it reads .cshrc otherwise. The question is: Why does which run without the -f option, which would cause it *not* to read .cshrc? I think that the answer is that it wants to handle aliases. The problem is that this can also cause the path to be changed (people who use remote shells know to define the path in .cshrc). One possibility to "fix" which would be to have it run with -f, check the path for all possibilities, source the .cshrc, and then check for aliases. Of course, this has problems, too. Personally, I prefer builtin commands for doing this job, like type in sh and Tony Birnseth's builtin which for csh. -- David Elliott dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce (408)944-4073