bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ${var@A}; hypothetical, related parameter transformations


From: Zachary Santer
Subject: Re: ${var@A}; hypothetical, related parameter transformations
Date: Sun, 24 Mar 2024 12:20:38 -0400

On Thu, Mar 21, 2024 at 4:08 PM Chet Ramey <chet.ramey@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.ramey@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'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]