I try to combine two bash files to create a dynamic configuration file. One of these files (settings.sh) contains variables and the other (config.sh) commands to execute on them.
For instance, in settings.sh I have
DATABASE='name_of_the_db'
USER='name_of_the_user'
and config.sh contains
. settings.sh
[...]
'NAME': '$DATABASE',
'USER': '$USER',
[...]
I'm struggling to create a command that would get the variable in the first file and insert it in the second, rendering a new file (settings.py) containing
'NAME': 'name_of_the_db',
'USER': 'name_of_the_user',
I tried a command like
cat < settings.py [...] EOF
as proposed here How does ` cat << EOF` work in bash? but this does obviously not perform any variable replacement.
Thank you in advance!