bug-bash
[Top][All Lists]
Advanced

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

Re: Bash Manual section 6.7 Arrays should mention array append notation


From: Greg Wooledge
Subject: Re: Bash Manual section 6.7 Arrays should mention array append notation
Date: Tue, 8 Mar 2022 12:38:52 -0500

On Tue, Mar 08, 2022 at 10:55:15AM -0500, Zachary Santer wrote:
> Talking about the lines with "+=", obviously. I only learned I could
> do this when I found it in existing code.

It's mentioned in the PARAMETERS section:

       uated.   When += is applied to an array variable using compound assign‐
       ment (see Arrays below), the variable's value is not unset  (as  it  is
       when  using  =),  and new values are appended to the array beginning at
       one greater than the array's maximum  index  (for  indexed  arrays)  or
       added  as additional key-value pairs in an associative array.  When ap‐
       plied to a string-valued variable, value is expanded  and  appended  to
       the variable's value.

It's not mentioned under Arrays, though.  Might not hurt to repeat it.



reply via email to

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