I have a variable $var. I want to create another variable named test_$var.
How can I call this variable after the initialization?
echo $test_$var doesn't work.
I have a variable $var. I want to create another variable named test_$var.
How can I call this variable after the initialization?
echo $test_$var doesn't work.
You can use declare
shell bulletin:
var='abc'
var1="$test_$var"
declare $var1=5
echo "${!var1}"
5