zsh says:
${name}
The value, if any, of the parameter name is substituted.
It then also says:
If a ${...} type parameter expression or a $(...) type command substitution is used in place of name above, it is expanded first and the result is used as if it were the value of name.
My question is why does the following not work then, assuming I am understanding it correctly, i.e. variable names can be nested?
echo $ab $fooz
foo 123
echo "${${ab}z}"
zsh: bad substitution
Expected:
123