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

Re: [PATCH] Forcing array interpretation in parameter substitution



Just realized that this isn't a "5.0.2" or so thing. Great commit really, it allows to index (z) result, or (s::) result, when there is no split and instead of array, a string is returned:

>: var="abc"; echo ${${(z)var}[1]}; echo ${${(Az)var}[1]} "<- so (A) does help"
a
abc <- so (A) does help

I wonder if there can be any workaround for older versions, tried (@z) or silly (0z) etc., and no make-array effect occurs.

--
Sebastian Gniazdowski
psprint /at/ zdharma.org



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