Answers for "bash function to populate associative array"

0

bash function to populate associative array

declare -a cols
while read num color; do
    cols[$num]=$color
done < file.txt
for key in "${!cols[@]}"; do printf "%s\t%s\n" "$key" "${cols[$key]}"; done
Posted by: Guest on April-01-2021

Code answers related to "bash function to populate associative array"

Browse Popular Code Answers by Language