#To create a array named "ARRAY" and set 4 values > set -A ARRAY a b c d #To display the entire list of values in array > echo ${ARRAY[@]} #To- display only value at a specific index > echo ${ARRAY[0]} #To get number of elements in the array > echo ${#ARRAY[@]} #To traverse through the list of elements in array > for i in ${ARRAY[@]} do echo $i done
In bash shell , the array is declared as
ARRAY=(a b c d)
Rest for the access is same as korn shell.
Comments
Post a Comment