Subject: Re: bin/9847: Adding test back in to /bin/sh as an internal function
To: NetBSD Bugs and PR posting List <netbsd-bugs@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 04/09/2000 13:27:58
[ On , April 9, 2000 at 22:48:32 (+1000), mason@primenet.com.au wrote: ]
> Subject: bin/9847: Adding test back in to /bin/sh as an internal function
>
> >Description:
> 	As /bin/sh is primarily used as a scripting engine, simple common
> 	external functions can/should be made internal to increase efficiency,
> 	maybe more so on lower end machines, by reducing forking and peak
> 	memory usage.
> 	It seems that at one stage some of these functions may have been
> 	internal anyway (see builtins.def).  Note that simple commands like
> 	``false'' and ``true'' were added back in.
> 
> 	This readds ``test'' and ``['' using the code from src/bin/test
> 	It doesn't add in ``expr''.  I've renamed a variable and a goto
> 	label in  sh.c  to avoid any symbol problems.

It would be good to have expr built-in too.  Of course all of the
builtins mentioned need to be available as separate programs too but
with code sharing for at least expr and test there's no real need to not
have them as builtins, and many advantages....

> 	I haven't got this so that it is not used when SMALL is defined in
> 	CPPFLAGS which I suspect should be done before this is added.

I'm not sure it should.  SMALL should only be for getting sh to run on
machines with truly limited I&D space and NetBSD doesn't have that
problem anywhere.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>