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

Re: Bad expansion



    Hello Zefram :))

>>    # Bad substitution
>>    echo ${${testing[1]}_VALUE}
>echo ${(e):-\$${testing[1]}_VALUE}
>The :-\ is a smiley that means "maybe there ought to be a neater way".

    Are you joking? XDD It works, but, AFAIK, this (apart from the
obvious smiley) means:

    "Expand <NULL> identifier, and, if it is not defined or missing
(which is true), expand the other thing, that is, \$${testing[1]}_VALUE"

    But, why? I mean, maybe there ought to be a neater way ;)))

    Really, I'm not an expert about parameter expansion. Just the
simple fact that you have provided me a solution is magic for me.

    Thanks a lot Zefram :)) And nice smile-like solution ;)))))

    Raúl



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