index=0while read vardoa[$index]="$var"index=`expr $index + 1`done < "a.txt"echo ${a[*]}
a.txt的第一行输出到 变量${a[0]} 第n行输出至变量${a[n-1]}