Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!cwns1!chet From: chet@cwns1.CWRU.EDU (Chet Ramey) Newsgroups: comp.unix.questions Subject: Re: which/type & built-ins Message-ID: <1990Jan2.160927.11935@usenet.ins.cwru.edu> Date: 2 Jan 90 16:09:27 GMT References: <1297@quintus.UUCP> Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 25 In article <1297@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: >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"? Because `while' is a sh language construct (a statement), not a shell builtin. It's a small but important distinction, and one of the chief reasons that programming in sh is so much better than programming in csh (in csh, these constructs *are* implemented as builtins, using very ad-hoc parsing with thousands of special cases that serves to reduce their usefulness to almost zero). -- Chet Ramey Network Services Group "Help! Help! I'm being Case Western Reserve University repressed!" chet@ins.CWRU.Edu