which/type & built-ins

Chet Ramey chet at cwns1.CWRU.EDU
Wed Jan 3 03:09:27 AEST 1990


In article <1297 at quintus.UUCP> ok at 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 at ins.CWRU.Edu			



More information about the Comp.unix.questions mailing list