我有一个非常基本的shell脚本,在这里:拼接输出成一行
for file in Alt_moabit Book_arrival Door_flowers Leaving_laptop
do
for qp in 10 12 15 19 22 25 32 39 45 60
do
for i in 0 1
do
echo "$file\t$qp\t$i" >> psnr.txt
./command > $file-$qp-psnr.txt 2>> psnr.txt
done
done
done
command
计算一些PSNR值,并写了一个详细的总结,以文件为file
,qp
和i
每个组合。没关系。
2>>
输出我真正需要的一行信息。但在执行时,我得到:
Alt_moabit 10 0
total 47,8221 50,6329 50,1031
Alt_moabit 10 1
total 47,8408 49,9973 49,8197
Alt_moabit 12 0
total 47,0665 50,1457 49,6755
Alt_moabit 12 1
total 47,1193 49,4284 49,3476
我想要什么,但是,是这样的:
Alt_moabit 10 0 total 47,8221 50,6329 50,1031
Alt_moabit 10 1 total 47,8408 49,9973 49,8197
Alt_moabit 12 0 total 47,0665 50,1457 49,6755
Alt_moabit 12 1 total 47,1193 49,4284 49,3476
我怎样才能做到这一点?
(请随意更改标题,如果你觉得有一个比较合适的一个)
我今天需要的究竟是什么!谢谢! – shiri 2017-03-17 14:35:31