我有一堆名为jtn216_<n>.o<m>
wheren
和m
是整数的文件。第一个是我分配的,第二个是系统分配的。我需要检查每个文件的最后一行。我运行它以将该行拆分为数组
for i in {361..380}; do
v=$(tail -n 1 jtn216_$i.o*)
IFS=' ' read -ra line <<< "$v"
echo $line $v
done
3499200 3499200 87650.5574975270 13.6931802555886
1014400 1014400 87947.4382620423 13.9208064005841 3475800 3475800 87779.1695691355 13.8939964916376 3479200 3479200 87459.7284508034 13.7824644675699 3827800 3827800
87868.7538056652 13.8792123626210 2551600 2551600 87615.6417285010 13.8700006744178 3818400
3818400 87872.1788028955 13.8942371285402 3476800
3476800 87842.0543708163 13.9170342642747 3481800
3481800 87670.5841054385 13.8808556469308
2559200 2559200
87800.6530231416 13.8874423695824 3841600
3841600 87804.3972028423
13.8657419719638
916400 916400
87776.1342228681 13.8622746230494
3839000 3839000 87662.8185016707 13.8576498806465
3835200 3835200 87933.6917697832 14.0007327053153
3482000 3482000 88323.3509854563 13.9453990979062 3485400 3485400 87657.5078357100 13.8478805156354 3484800 3484800 87757.3379321554
13.8215034461609 3475400 3475400 87970.4729449120
13.9605031841208 3481800
3481800 87612.4211302676
13.8327950845915 2319400
2319400 87521.5669854330 13.8383953325475
我希望line
成为一个数组而不是v
. 我究竟做错了什么?