Hello Léa!
Léa Gris wrote:
> I was trying to play the the -v test to detect when an array or
> associative array has been declared, not necessarily assigned entries
> key, values, to not error when Bash runs with -o nounset
Just for the curious: What is your attention here?
I think that most us
Le 12/12/2019 à 20:13, Chet Ramey écrivait :
>> # Empty array declared without parenthesis
>> unset myArr
>> declare -a myArr
>> typeset -p myArr
>> echo "${#myArr[@]}"
>
> This is an unset variable with the array attribute; you have not assigned a
> value.
>> # Empty array declared without paren
On 12/12/19 12:08 PM, Léa Gris wrote:
Hello,
Depending on how an empty array is declared, it is not stored with the
same state.
# Empty array declared without parenthesis
unset myArr
declare -a myArr
typeset -p myArr
echo "${#myArr[@]}"
This is an unset variable with the array attribute; you
On Thu, Dec 12, 2019 at 1:10 PM Léa Gris wrote:
> Hello,
>
> Depending on how an empty array is declared, it is not stored with the
> same state.
>
> # Empty array declared without parenthesis
> unset myArr
> declare -a myArr
> typeset -p myArr
> echo "${#myArr[@]}"
>
> output:
> declare -a myArr
Hello,
Depending on how an empty array is declared, it is not stored with the
same state.
# Empty array declared without parenthesis
unset myArr
declare -a myArr
typeset -p myArr
echo "${#myArr[@]}"
output:
declare -a myArr
0
# Empty array declared without parenthesis
unset myArr
declare -a myA