1. [root@zyl scripts]# cat array.sh
2. #!/bin/sh
3. zhang=(
4. wujiangping
5. shuzhaoqiang
6. renhepeng
7. peijiaying
8. zhangyiling
9. )
10. for ((i=0; i<${#zhang[*]};i++))
11. do
12. echo"this is num $i,then name is ${zhang[$i]}"
13. done
14. echo -e "\033[32m================================\033[0m"
15. for n in${zhang[*]}
16. do
17. echo$n
18. done