Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!newstop!sun!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.unix.questions Subject: which/type & built-ins Message-ID: <1297@quintus.UUCP> Date: 1 Jan 90 02:44:53 GMT Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 20 Does anyone know why the C shell command "which" (ok, /usr/ucb/which) and the Bourne shell command "type" don't understand built-in commands? The manual page for csh says which [ filename ] ... which takes a list of names and looks for the files which would be executed had these names been given as commands. (Should be ^^^ "would have been", such grammar!) which makes it clear that "which if" isn't supposed to recognise "if" as a command. I don't quite see why; surely it would be easy for /usr/ucb/which to execute an appropriate switch() after everything else has failed. The manual page for sh says type [ name ... ] For each name, indicate how it would be interpreted if used as a command name. This certainly looks to me as though "type if" SHOULD succeed, and "type type" _does_. So why does "type while" say "while not found" rather than "while is a shell builtin"?