linux - How to get the size of the second dimension of two dimensional arrays in bash? -
if have
arr[0,0]=0; arr[0,1]=1; and try
echo ${#arr[0,@]} i got
bash: 0,@: syntax error: operand expected (error token "@") what correct way size of second dimension or arr?
multi-dimensional arrays not supported in bash.
nevertheless, simulate them using various techniques.
the following definitions same:
arr[1,10]=anythingarr["1,10"]=anything
both evaluated arr[10]=anything (thanks chepner):
echo ${arr[10]}
Comments
Post a Comment