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

Expand each array element with ${(P)...}



I have an array of variable names that I would like to expand to an array of these variables' values.

I was expecting that if $names is an array, then ${(P)names} – or perhaps something like ${(PA)names[@]} – would perform ${(P)...} expansion on each element, but it doesn't. It just expands the first element in the array instead and leaves out the rest.

Is there any way to make this work without using a for loop? I could not find any combination of (nested) expansion flags that does what I want.



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