which/type & built-ins

David Elliott dce at smsc.sony.com
Wed Jan 3 04:31:20 AEST 1990


In article <21912 at adm.BRL.MIL> reschly at 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 at smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
(408)944-4073
"But Pee Wee... I don't wanna be the baby!"



More information about the Comp.unix.questions mailing list