Here is the scenario:
The System is preset with the following Environment Variables:
INNER1=1
INNER2=2
INNER3=3
Now I have the file: values.properties
OUTER1=$INNER1
OUTER2=$INNER2
OUTER3=$INNER3
I also have a shell script named: run.sh
#!/bin/sh
PROPERTIES_FILE=values.properties
while IFS== read -r VAR1 VAR2
do
export $VAR1=$VAR2
done < $PROPERTIES_FILE
Now the problem is, when I run the script, the following is exported:
OUTER1=$INNER1
OUTER2=$INNER2
OUTER3=$INNER3
But the desired result should be:
OUTER1=1
OUTER2=2
OUTER3=3
I want it to fully resolve the variable name when exporting it.