change expansion for key-value pair compound assignment to associative arrays to split all words before identifying keys and values; controlled by a new shopt option: kvpair_split, enabled by default; new `loadassoc' loadable builtin to load an associative array from a set of key-value arguments

This commit is contained in:
Chet Ramey
2026-08-17 10:09:07 -04:00
parent 9c8a70bc9e
commit 2f7eb80c77
38 changed files with 1083 additions and 1012 deletions
+5
View File
@@ -52,6 +52,11 @@ typedef struct element_state
more than once, when performing variable expansion. */
extern int array_expand_once;
/* This means to split the words in a compound associative array assignment
before the keys and values are identified, so the expanded and split words
can be used as separate keys and values. */
extern int split_kvpair_assignments;
/* Flags for array_value_internal and callers array_value/get_array_value; also
used by array_variable_name and array_variable_part. */
#define AV_ALLOWALL 0x001 /* treat a[@] like $@ and a[*] like $* */