Source lets you add external files/code into your scripts, but is also a great way of adding config files, providing you are aware of the risks.
The benefits are that source is extremely quick to run, with memorable syntax.
The risks are that all code in the file(s) you source will be run, even if you only anticipated the file holding variables.
In short, if there's any chance of anyone else adding/editing the config files (a curious user, perhaps), then source isn't the right option.
Let's say you have a config file (
config.ini) that contains
In your script, you can use
source or the shorthand
. config.ini # or: source config.ini echo $your_var >>> your_val
But if your curious user updates
config.ini, adding the line
reboot... You've been warned!