On Wednesday, April 03, 2013 11:53:48 PM konsolebox wrote: > Hi. I made a post on this before but I haven't got a reply. I actually want > to know what people think about the idea as I actually find a command like > this really helpful. Anyone please? > > On Wed, Feb 6, 2013 at 11:30 AM, konsolebox <konsole...@gmail.com> wrote: > > > Hi. I was wondering if we could add a builtin where we could use it as an > > alternative for assigning values to a parameter. And thought of a builtin > > name called setvalue. With it we could assign values to a normal variable, > > an array, or an associative array.
This is more or less identical to the ksh88 `set -A'. If anything were to be added, it would probably be that. I assume Chet preferred enforcing more consistent syntax rather than adding something redundant to ksh93-like compound assignment syntax. The primary advantages to set -A are: - It's the most portable way to assign multiple elements to an indexed array other than a separate assignment for each element. - The combination `set -sA' provides a means of sorting (lexicographically). Bash currently has no built-in way to sort an array or the positional parameters. -- Dan Douglas