shell 获取数组的长度
作者:互联网
code
macname@localhost Desktop % cat test.sh my_array[0]=A my_array[1]=B my_array[2]=C my_array[3]=D echo "数组元素个数为: ${#my_array[*]}" echo "数组元素个数为: ${#my_array[@]}"% macname@localhost Desktop % macname@localhost Desktop % ./test.sh 数组元素个数为: 4 数组元素个数为: 4
标签:shell,macname,数组,长度,array,Desktop,my,localhost 来源: https://www.cnblogs.com/sea-stream/p/14038514.html