I am trying to substitute a variable inside another variable in shell script. but its showing as empty string. Below is the scenario.
- Assigning "x" with string containing variable "abc"
~$ x="new value is \${abc}"
~$ echo $x
new value is ${abc}
- Below is content of script abc.sh, defining the value of abc->
#!/bin/bash
abc="something='123:234'"
xyz=$@
echo $xyz
- When executing command "sh abc.sh $x" getting below value.
actual -> new value is ${abc}
expected - > new value is something='123:234'
Please help solving above issue.
Thanks