Tugger the SLUGger!SLUG Mailing List Archives

Re: [chat] portable scripting


On Thu, 2003-02-06 at 11:24, Conrad Parker wrote:

> pkg-config replaces this with a compiled program that parses simple
> config files like this one (Erik's from libsndfile):
> 
> conrad@screech:~% cat /usr/local/lib/pkgconfig/sndfile.pc 
> prefix=/usr/local
> exec_prefix=${prefix}
> libdir=${exec_prefix}/lib
> includedir=${prefix}/include
> 

I now do a lot of script and I have found that the easiest thing I can
do is source.  I simply set my defaults with:

source my_params.
if [ -z "$something" ] ; then
	something=default
fi


extend this with a variable based around your system, in my case it is
customer which is set at a high level for file transmissions, etc:

source system_defaults
source system_$cust

system_MYCUST contains script lines like A=B and you then have a simple
script variable like A assigned to B.

WORKDIR=/customer/temp
RPTDIR=/customer/reports

....

Amazing how flexible script is once you have thought through a solution.

-- 
Thanks
KenF
OpenOffice.org developer