bash - evaluating variable that comes in an array in shell script -


i trying read xcode build settings via shell script, i.e. if there build setting called product_name, read value writing echo ${product_name} in shell script.

now, product_name in array, lets call myarr having 1 element product_name. loop on array as

for in "${myarr[@]}" :     echo $i  done 

echo $i output product_name. however, want write evaluate ${product_name} , give me results.

i have tried eval echo $i outputs product_name only

solved using

echo "${!i}"

the second line gives output desired. have taken answer here: how variable value if variable name stored string?


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -