I think this is what you are looking for....let me know if it is not.
(Assuming you are using sh or ksh)
in your config file do stuff like....
# This is the configuration file for XXX
# Please place double quotes around all entries that have spaces in there
# values after the equals sign, ie FileList="file1 file2 file3"
# #This parameter is the name of the logfile
logfile=/tmp/log.out
#
#
# TEMPORARY INCREMENT FILE
pivot='"tmp/.fileCount"
#
# CONNECTING STRING
# Place user name here
USERNAME=aaaaa
# #Place passwd here
PASSWORD=bbbbb
# #Place Dbname here
DBNAME=xxxxx
# #this is the end of the config file
Now in your MAIN script all you do is....
#!/bin/sh
# This is my main script
# First need to source the config file
# if we can not read the cfg then exit!
if [ -r /path/to/config.cfg ]
then
# getting config file
. /path/to/config.cfg
else
echo "Can not read config.cfg
exit 99
fi