On Thu, Mar 21, 2024 at 4:08 PM Chet Ramey <chet.ra...@case.edu> wrote: > > On 3/20/24 3:05 PM, Zachary Santer wrote: > > > it's more work > > than if there were three separate parameter transformations. one each > > to always generate a declare command; an assignment statement; and the > > right hand side of a compound assignment statement or standard > > assignment statement, depending on whether it's dealing with an > > array/assoc or scalar. > > I am not convinced that tripling the number of relevant variable > transformations makes the problem any simpler.
It's simpler in the sense that the bash programmer can choose the behavior they want and are guaranteed to get it. On Thu, Mar 21, 2024 at 4:12 PM Chet Ramey <chet.ra...@case.edu> wrote: > > If you want to be guaranteed a declare command for a particular name, > use `declare -p'. Parse the result of a (nofork) command substitution > if you must. That's fair. I kind of figured ${var@A} was intended to replace 'declare -p'.