【发布时间】:2016-08-31 08:55:16
【问题描述】:
如何从文件中读取行反转,
#cat file
hello world
hello world bash
所以我需要这样的输出,
world hello
bash world hello
【问题讨论】:
-
我在这里给出了答案:stackoverflow.com/a/39316690/2361131 负责从文件中读取(与“重复问题”的其他答案不同)
如何从文件中读取行反转,
#cat file
hello world
hello world bash
所以我需要这样的输出,
world hello
bash world hello
【问题讨论】:
awk '{for(i=NF;i>=1;i--) if(i!=1)printf $i" ";else print $i}'
world hello
bash world hello
【讨论】: