Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Nested substitutions.



I will ask a question through an example...

I have a variable called E. It contains the string EDITOR.
I have a variable EDITOR set to /usr/local/bin/emacs.

I would like to obtain the value of EDITOR through E.  According to
the man page (zshexpn), it seems like ${${E}} should work. However,
this simply evaluates to EDITOR, instead of /usr/local/bin/emacs.

I actually went through a long and tedious trial-and-error session
with all kinds of combinations of eval, $(...), etc. etc.

Can someone please tell me how to indirectly get the value
'/usr/local/bin/emacs' through a reference to E ?

Thanks!

P.S. I looked through a lot of example scripts and the FAQ and list
archives, but didn't find anything. Perhaps I didn't look hard enough.



Messages sorted by: Reverse Date, Date, Thread, Author