As a rule, when you have one file, another is created, you execute some kind of template. While bash is capable of this, you can consider another tool. m4 is a popular tool used in the GNU toolchain. For simpler templates, you can do something like the following perl script:
perl -pne BEGIN { open my $fh, $ENV{SERVER_PROPERTIES_FILE} or die $!; \ %hash = map { chomp; split /=/ } <$fh>; } s/\${(.*)}/$hash{$1} or die "missing $1"/eg' < "${SERVER_XML_FILE}
If you don't need a second file, you can do most of the things in a bash script using the docs and inline execution here.
source share