#! /bin/bash declare -a arr1 declare -a arr2 while read line do arr=($line) arr1[${#arr1[@]}]=${arr[0]} arr2[${#arr2[@]}]=${arr[1]} done < nowcoder.txt echo ${arr1[@]} echo ${arr2[@]}
#! /bin/bash declare -a arr1 declare -a arr2 while read line do arr=($line) arr1[${#arr1[@]}]=${arr[0]} arr2[${#arr2[@]}]=${arr[1]} done < nowcoder.txt echo ${arr1[@]} echo ${arr2[@]}