I'm trying to replace substrings delimited by characters in a string by the values of their matching bash variables in shell.
So far, I've tried this without any success:
varone="noob"
vartwo="trivial"
echo "my {varone} and {vartwo} question" | perl -pe 's|(.*){(\w+)}(.*)|${1}'$(echo "${'${2}'}")'${3}|g'
But I get:
bash: ${'${2}'}: bad substitution
Any idea on how to do this? Thanks in advance!