Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to print array bash

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
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #print #array #bash
ADD COMMENT
Topic
Name
2+6 =