I have list of parameters that take from a property file looks like that:
db_instanceid=i-0c2b12ae02d454018
db_secgrp=sg-8c2efcf3
backend_instanceid=i-0199621ba358d1814
backend_secgrp=sg-5e508221
frontend_instanceid=i-0199621ba358d1814
frontend_secgrp=sg-e152809e
in bash, I want to use an array to perform actions using those parameters, Something like that:
declare -a arr=("frontend" "backend" "db")
for i in "${arr[@]}"
do
inter=$i
echo "Get PublicIp for $inter server"
echo "$inter security group - $inter_secgrp" ;
done
But $inter_secgrp itself will be read as a parameter, so I get an empty string (which make sense). How can I read this parameter the right way so I will get the value of all "secgrp"
needed output:
Get PublicIp for frontendserver
frontendserver security group - sg-e152809e
Get PublicIp for backend
backendsecurity group - sg-5e508221
Get PublicIp for db
dbsecurity group - sg-8c2efcf3
evalis a must this time :)