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

Re: unset "hash[key]" isn't matched with what "key" may be



On 7 February 2016 at 20:08, Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Sun, 7 Feb 2016 15:16:05 +0100
> Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
>> I had a loop in which I browsed $functions, setting:
>>
>>                 func[$i]=1
>>
>> where "func" is a hash and "$i" is ${(k)functions}. This worked, however this:
>>
>>                 unset "func[$i]"
>
> Not sure what you're doing, but it's apparently not equivalent to the
> following, which appears to work.  There may be some relevant option,
> I suppose.
>
> % i='${(k)functions}'

Sorry, by:

>> where "func" is a hash and "$i" is ${(k)functions}. This worked, however this:

I meant that "$i" iterates over keys of $functions

Best regards,
Sebastian Gniazdowski



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