1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| #! env sh
list1=(1 2 3 "hello")
list2=( 1 2 "hello" )
list2[5]='No_5' list2[4]='No_4'
echo ${list1[0]} ${list1[1]} ${list1[2]} ${list1[3]}
echo ${list2[@]}
echo ${#list2[@]} echo ${#list2[*]}
echo ${#list2[5]}
|