hi list,
I am currently looking to develop an installation script which writes out .conf files based on existing .conf files according to variables which are set in a settings file.
For example I have a settings file like so:
ip=192.168.1.1
hosts=local
And I want to read a file which looks like this:
[test]
ip_address=$ip
hostname=$hosts
othervalue=110
testfield=testvalue
And create an output file so that it looks like this whilst leaving all other fields in the source file intact except for the variables:
[test]
ip_address=192.168.1.1
hostname=local
othervalue=110
testfield=testvalue
What is the best way to script this?
thanks,
lland