Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.unix.questions Subject: Re: which/type & built-ins Message-ID: <1990Jan2.173120.6311@smsc.sony.com> Date: 2 Jan 90 17:31:20 GMT References: <21912@adm.BRL.MIL> Reply-To: dce@Sony.COM (David Elliott) Organization: Sony Microsystems Corp. Lines: 26 In article <21912@adm.BRL.MIL> reschly@BRL.MIL (Robert J. Reschly Jr.) writes: > The "which" command is an independent program (actually a C-shell >script) which can be called from any command interpreter. Since the >various command interpreters offer differing sets of built-in commands, >"which" cannot presume to know anything about built-in commands. >Additionally there is no reasonable way for "which" to learn this >information. Good try, but I don't think I can buy that, at least not as the only reason. You see, "which" will also look for aliases if you have a ~/.cshrc. If it was completely independent, it would at least look at SHELL to see if you are running sh or csh as your default shell, and with that info it could decide on a list of builtins to use. IMHO, the best way would be for each shell to have a builtin "what would I run if I gave this name" command, and Unix would have a "what's the pathname of this command" command, like the Tektronix systems have. -- David Elliott dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce (408)944-4073 "But Pee Wee... I don't wanna be the baby!"