bash array length

来源:互联网 发布:apache tomcat9.0安装 编辑:程序博客网 时间:2024/06/06 17:17

http://unix.stackexchange.com/questions/193039/how-to-count-the-length-of-an-array-defined-in-bash

#!/bin/basharray=( item1 item2 item3 )for index in ${!array[@]}; doecho $index/${#array[@]}doneecho ${!array[@]}echo ${#array[@]}


0 0
原创粉丝点击