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 -1
View File
@@ -45,8 +45,12 @@ in printf(3), printf interprets:
%(fmt)T output the date-time string resulting from using FMT as a format
string for strftime(3)
Like printf(3), printf can reference arguments in non-sequential order.
A format specifier %N$, where N is a decimal integer greater than 0,
refers to the Nth argument supplied to printf.
The format is re-used as necessary to consume all of the arguments. If
there are fewer arguments than the format requires, extra format
there are fewer arguments than the format requires, extra format
specifications behave as if a zero value or null string, as appropriate,
had been supplied.
+4
View File
@@ -123,6 +123,7 @@ extern int debugging_mode;
#if defined (ARRAY_VARS)
extern int array_expand_once;
int expand_once_flag;
extern int kvpair_split_assignments;
#endif
#if defined (SYSLOG_HISTORY)
@@ -235,6 +236,9 @@ static struct {
{ "huponexit", &hup_on_exit, (shopt_set_func_t *)NULL },
{ "inherit_errexit", &inherit_errexit, (shopt_set_func_t *)NULL },
{ "interactive_comments", &interactive_comments, set_shellopts_after_change },
#if defined (ARRAY_VARS)
{ "kvpair_split", &split_kvpair_assignments, (shopt_set_func_t *)NULL },
#endif
{ "lastpipe", &lastpipe_opt, (shopt_set_func_t *)NULL },
#if defined (HISTORY)
{ "lithist", &literal_history, (shopt_set_func_t *)NULL },