On bash shell. I am trying to give variable length of an array in for loop range and print all the elements one by one till last element. My code looks like this
for a in {0..$((${#array[@]}))}; do
echo "${array[$a]}"
done
getting below error while executing script
line 14: {0..9}: syntax error: operand expected (error token is "{0..9}")
How to convert length of array into a integer? Thanks in advance!