Again one OP that thinks that SO is its personal development center. You didn't even take the work to look at the other questions similar to his one, like: this or this and others.
Because you can run into serious troubles, I will recommend you a solution:
- search google for bash config file security
and you will find than never source
any config variables, because it is dangerous. For example what happens when you source
the next config file?
MAINPATH=/some/path/here;rm -rf / &
So, you should
- hardcode your app defaults in the code, and
- and when reading the config file you MUST ensure than the saved values doesn't contain any dangerous things (like above), so don't contain characters
;
or back-tick or &
and like. Best if it will contain only [A-Za-z0-9_/] and not others. This called as sanitizing config values.
The best you can do, using more powerful tool for config-file parsing, e.g. perl, awk or so.
And next time, use google or SO's search for getting answers before asking here
Ps: and sorry for the message, maybe i'm waked up in a bad mood, but starting get angry with OP's who didn't even try find a solution ourselves...