Tell bash I have:
c=3 b3=4
instead:
echo $b3
what is the command to output "4"? I tried at the bottom but couldn't.
echo $b($(c))
echo $b{!c}
echo $b${c}
echo ${d[$c]}
You can use an indirect reference for this:
$ c=3 $ b3=4 $ d=b$c $ echo "${!d}" 4
Although, in general, arrays should be used instead of indirect references whenever possible.