$ printf '%s
' "${my_array[@]}"
echo "${array[*]}"
for i in ${!myArray[@]}; do
echo "element $i is ${myArray[$i]}"
done
echo ${resnew[0]} - first element
echo ${resnew[1]} - second element
echo last : ${resnew[$(($res_len -1))]} last element
echo last : ${resnew[ $(($res_len -1)) ]} last element
^resnew_array[ ^get value from varible by solving $res_len-1 ^array close
printarr() { declare -n __p="$1"; for k in "${!__p[@]}"; do printf "%s=%s
" "$k" "${__p[$k]}" ; done ; }