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

Re: Build a variable name from another variable?



On Jan 23,  7:51pm, Omen Wild wrote:
} 
} Quoting Philippe Troin <phil@xxxxxxxx> on Fri, Jan 23 15:19:
} >
} > % t="${baz}contents"   
} > % echo ${${(P)t}}
} > bar contents
} > 
} > Works...
} > i could not manage to do it without an intermediate variable.
} 
} Ah, this will probably work for me.

Here it is without the intermediate variable:

	${(P)${:-${baz}contents}}



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