I was wanting to initialize some strings at the top of my script with variables that have no yet been set, such as:
str1='I went to ${PLACE} and saw ${EVENT}'
str2='If you do ${ACTION} you will ${RESULT}'
and then later on PLACE, EVENT, ACTION, and RESULT will be set. I want to then be able to print my strings out with the variables expanded. Is my only option eval? This seems to work:
eval "echo ${str1}"
is this standard? is there a better way to do this? It would be nice to not run eval considering the variables could be anything.