I am reading a .properties
file from my shell script.
I wanted to read some value for some key and after that want to append it in between some string but the output is weird.
#!/bin/bash
# Script used to read Property File
FILE_NAME="Test.properties"
prop_value=$(cat ${FILE_NAME} | grep Address)
echo "ABC${prop_value}DEF"
my Test.properties is like this
Name=Pravin
Age=25
Address=Mumbai
asd=asd
After executing this script I am expecting
ABCAddress=MumbaiDEF
but I am getting output like
DEFAddress=Mumbai
What would be the problem here?
If I define any variable in a script it works, but when I read it from file using command expansion it doesn't work.