using config file

Hello

I got script where is defined path name, connect string to database and
name of the log file.

I would like to create a new config file which will be consists of these path name, connect string and name of the log file.

But I don't know how to use this config file into the main script?
Or how to create a nice config file for other use?

For example of config file:
# TEMPORARY INCREMENT FILE
pivot='/tmp/.fileCount'

# CONNECTING STRING
USERNAME aaaaa
PASSWORD bbbbb
DBNAME xxxxx
---------------------------------------------

Thanks a lot

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

echo "$logfile"
echo "$pivot"
echo "$USERNAME"
echo "$PASSWORD"
echo "$DBNAME"

You can use "." or the "eval" inside your main script to source the information from your config file depends how and what you are sourcing

Hope this is what you are after