Skip to content

Commit 1a7a479

Browse files
committed
!fixup e2a3662 [doc/ref/chap-osh-assign] Mention assoc=(k v ...) with strict_array
1 parent 1e0930e commit 1a7a479

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/ref/chap-osh-assign.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ item in order. An item in the initializer list must be in the forms
251251
a+=([k]=5) # This overwrites an element in the original
252252
# array. The result is ([a]=3 [b]=4 [k]=5).
253253

254-
As a special rule, when the first initializer form does not have `[<key>]=` or
255-
`[<key>]+=`, the initializer items are treated as a sequence of `key1 value1
256-
key2 value2 key3 value3 ...`.
254+
As a special rule, when the first initializer form does not have `[KEY]=` or
255+
`[KEY]+=`, the initializer items are treated as a sequence of `KEY1 VALUE1 KEY2
256+
VALUE2 KEY3 VALUE3 ...`. OSH disables this feature when `strict_array` is set.
257257

258258
declare -A a=(1 2 3 4) # This creates a BashAssoc with two elements,
259259
# ([1]=2 [3]=4)

0 commit comments

Comments
 (0)