现在,我通过命令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
由于我跑了很多管道在此之前,它会在一个循环中运行,如果你知道我宁愿任何简单的解决方案,无需创建新的循环和逐行读取。我只是希望它一次只能用于一行,因此我可以将它放在循环中。感谢您的考虑。