help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Counting words, fast!


From: Lawrence Velázquez
Subject: Re: Counting words, fast!
Date: Sat, 20 Mar 2021 00:25:28 -0400

> On Mar 19, 2021, at 11:18 PM, Koichi Murase <myoga.murase@gmail.com> wrote:
> 
> For the associative array, I somehow could not find in the manual even
> a description that the associative arrays support the assignment of
> the form `name[subscript]=value'.

It is later on the same page:

        When assigning to an associative array, the words in a compound
        assignment may be either assignment statements, for which the
        subscript is required, or a list of words that is interpreted as
        a sequence of alternating keys and values: name=(key1 value1
        key2 value2 ...). These are treated identically to name=(
        [key1]=value1 [key2]=value2 ...). The first word in the list
        determines how the remaining words are interpreted; all
        assignments in a list must be of the same type. When using
        key/value pairs, the keys may not be missing or empty; a final
        missing value is treated like the empty string.

        This syntax is also accepted by the "declare" builtin.
        Individual array elements may be assigned to using the
        name[subscript]=value syntax introduced above.

vq



reply via email to

[Prev in Thread] Current Thread [Next in Thread]