Few days back i had read something as follows posted by vivek (old forum) which basically changes the values of the config file
Code:
CF="/etc/test.config"
mod(){
NCF="$CF.$$"
[ ! -f $CF ] && touch $CF || :
V="$1"
grep -v -E "^$V=" $CF > $NCF
mv -f $NCF $CF
eval echo "$V=\"'\${$V}'\"">> $CF
}
# test data
host='me.test.com'
mod host
mod ip
Save file and Execute
It will create /etc/test.config as follows
host='me.test.com'
ip=''
Again if you modify the script file with test data
host='YOU.test.com'
And script executed now output will be changed to as follows
host='YOU.test.com'
ip=''"
Try this one or may be we can play more with sed ....

later ..