Bourne shell modifications, past and future (long)
chris
chris at pixutl.UUCP
Tue Nov 19 02:19:52 AEST 1985
>
> > I think the most glaring difference between csh aliasing and
> > sys5 bourne shell functions is that the latter looks up builtins first.
> > This means you can't define functions that clash with shell commands.
> > On the other hand shell functions have a MUCH better syntax. Why not
> > move up the expansion of shell functions ahead of builtins at
> > the expense of not having recursive functions.
>
> Very good question. My guess is that either (a) it was easier
> to do it the other way, or (b) it would be considered a security
> problem in restricted shells. Can DGK tell us why?
The main implementation problem in having functions overrule builtins is
that both builtins and functions share the same B-tree. If you wanted to
have a function with the same name as a builtin, you would have to save
it somewhere, add new flags, etc... all that adding overhead and
complexity.
Chris
--
Chris Bertin : (617) 933-7735 x2336
Pixel Systems Inc. : (800) 325-3342
300 Wildwood street : {allegra|ihnp4|cbosgd|ima|genrad|amd|harvard}\
Woburn, Ma 01801 : !wjh12!pixel!pixutl!chris
More information about the Comp.unix.wizards
mailing list