【发布时间】:2018-03-22 09:14:09
【问题描述】:
现在,我正在通过命令 xargs -n1 | sort -u | xargs(我在此处找到:Sorting and removing duplicate words in a line)传递一些行。
但是,我的问题是,当管道多条线路时,它会将所有线路放在一起。我该如何通过管道:
My first example line for example
My second example line for example
My third example line for example
得到:
My first example line for
My second example line for
My third example line for
由于在此之前我运行了很多管道,并且它将在一个循环中运行,如果您知道任何简单的解决方案而不创建新的循环并逐行读取,我会更喜欢。我只希望它一次只为一行工作,所以我可以把它直接放入循环中。感谢您的考虑。
【问题讨论】: