Hi,
I have a config file that contains:
my.config:
Code:
Section
INSTALLATION_PATH = $HOME
EndSection
Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.
here is my parse_cmd script:
Code:
#Get the parameter from the section
RESULT=`sed -n "/Section/,/EndSection/p" $1 | grep -w $3`
#Ignore comment
RESULT=`echo $RESULT | awk -F# '{print $1}'`
#remove all beginning white spaces
RESULT=`echo $RESULT | awk -F= '{print $NF}' | awk '{sub("^ ", "", $0); print $0}'
#return value
echo $RESULT
exit 0
Any idea how to get around the problem.
Thanks,
Indy