declare -a ary ary+=( one ) ary+=( two ) ary+=( three ) echo ${ary[2]} echo ${ary[1]} echo ${ary[0]} # three # two # one echo --------- echo ${ary[*]} # one two three echo --------- printf "%s\n" "${ary[@]}" # one # two # three
Index