积少成多

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

#!/bin/bash

 

arr=(1 2 3 4 5 6)

 

echo "print the elemetn as \${arr[idx]}"

for((i=0; i<6; i++))

do

    echo ${arr[$i]}

done

 

echo "print the element as a list \${arr[*]}"

echo ${arr[*]}

 

 

echo "print the element as a list \${arr[@]}"

echo ${arr[@]}

 

echo "print the len of arr: \${#arr[*]}"

echo ${#arr[*]}

posted on 2017-05-27 13:52  x7b5g  阅读(149)  评论(0编辑  收藏  举报