• + 0 comments

    !/bin/bash

    Initialize an empty array

    countries=()

    Read lines until EOF and append each country to the array

    while IFS= read -r line; do countries+=("$line") done

    Print all countries separated by spaces

    echo "${countries[@]}"