Follow-up to the background part in this question.
In bash
I can use ${!FOO}
for double substitution, in zsh
${(P)FOO}
. In both, the old-school (hack-y) eval \$$FOO
works.
So, the smartest and most logical thing for me would be ${${FOO}}, ${${${FOO}}}…
for double/triple/n substitution. Why doesn’t this work as expected?
Second: What does the \
do in the eval
statement? I reckon it’s an escape, making something like eval \$$$FOO
impossible. How to do a triple/n substitution with that that works in every shell?
l3=l2; eval eval eval echo \\\$\\$\$$l3
→53294
so not exactly modular. – Profpatsch Mar 15 '13 at 11:29eval $(eval echo \$$l2)
? I hate bash, it makes absolutely no sense. – Profpatsch Mar 15 '13 at 11:31