Subject: Re: Proposed rc.d changes....
To: Greywolf <greywolf@starwolf.com>
From: Simon J. Gerraty <sjg@quick.com.au>
List: tech-userlevel
Date: 02/19/2001 22:36:02
>	- Has anyone at all considered the potential of, at system rc
>	  run time,
>		loading /etc/defaults/rc.conf
>		loading /etc/rc.conf
>	  ONCE and then just _sourcing_ the scripts with the same shell,
>	  with perhaps a macro which tests to see if the requisite routine
>	  has been loaded in order to avoid multiple sourcing/reading/
>	  forking?

Don't know, but I use the following trick to allow what (I think) 
you are talking about.

In foo.sh

_FOO_SH=:

in things that want to use foo.sh, but avoid reading it multiple times:

$_FOO_SH . foo.sh

The one that really made this important was source.sh, which did things like
searching a given path for rc files and sourcing them etc.  If one of
those redfined source() directly or indirectly (while we were running it), 
the shell on at least some systems would die.

--sjg