Answer the question
In order to leave comments, you need to log in
How to substitute the number of elements of an array into a bash variable?
Good afternoon.
For example:
There is an array ${{my_array[@]}, data comes to it from a function.
If I write
echo ${{#my_array[@]}
Outputs: 11 The
question is, how can I substitute this number 11 into a variable??
i=${{#my_array[@]} - doesn't roll (
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question