You are viewing a single comment's thread. Return to all comments →
countries=()
while IFS= read -r line; do countries+=("$line") done
echo "${countries[@]}"
Seems like cookies are disabled on this browser, please enable them to open this website
'Awk' - 3
You are viewing a single comment's thread. Return to all 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[@]}"