Re: test -v difference between bash 5.1 and 5.2

2023-08-30 Thread Christian Schneider
Hi all, thx for your answers. TBH, I couldn't follow all your explanations, but the gist, is, that it's intentional and not a bug. We will use the ${#foo[@]} > 0 test, that is probably the right in our situation. Background is, the test is in shared code, and we are doing some sanity checks on t

test -v difference between bash 5.1 and 5.2

2023-08-29 Thread Christian Schneider
Hi all, not sure if this intended or not, but in bash 5.2-p15 one of our scripts is broken. it is related to test -v, that checks, if a variable is set together with arrays. I condensed it to following example: #!/bin/bash declare -A foo foo=(["a"]="b" ["c"]="d") declare -a bar bar=("a" "b"