📅  最后修改于: 2022-03-11 14:57:34.344000             🧑  作者: Mango
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