Count the number of elements in an Array

  • + 0 comments
    tab=()
    while read country; do 
        tab+=("$country")
    done
    
    # print length of table
    echo "${#tab[@]}"