Re: ${y@a} on an empty array y fails with 'y: unbound variable' if run with set -u

2021-10-26 Thread Alex fxmbsw7 Ratchev
if u're trying to save a var, or rename one, declare -p output saving was my way to do so On Tue, Oct 26, 2021, 19:09 Mark March wrote: > >"An array variable is considered set if a subscript has been assigned a > value." > > My bad, I missed that. However, there is an argument to be made that >

Re: ${y@a} on an empty array y fails with 'y: unbound variable' if run with set -u

2021-10-26 Thread Mark March
>"An array variable is considered set if a subscript has been assigned  a >value." My bad, I missed that. However, there is an argument to be made that ${foo@a} and ${foo@A} transforms should be exempt from the nounset option if foo is an unset array. An attempt to obtain the value (or somethin

Re: ${y@a} on an empty array y fails with 'y: unbound variable' if run with set -u

2021-10-26 Thread Chet Ramey
On 10/25/21 8:24 PM, Mark March wrote: > If -u is on and you declare a simple or associative array 'y' and set it > empty, then ${y@a} will fail with 'unbound variable'. It really is unset: "An array variable is considered set if a subscript has been assigned a value." > I was able to repro th