I have a problem that I am not able to solve, i need replace values of text variable in sh by the value of local variables. Example:
~/Documents$ VERSION=1.0.0
~/Documents$ TEST='This is a test, VERSION: $VERSION'
~/Documents$ echo $TEST
This is a test, VERSION: $VERSION
I would like to transform the TEST string so that it uses the values of the local variables. I know I could change the ' ' to " " and that would work, but in my problem I get a literal string so I can't just do that.
Edit: I am trying to convert a literal string into a string with replacement of values by local variables in words beginning with "$", I could do this with a simple regex but I am looking for a better way, I believe that you should achieve this using only simple SH commands.