我有这个输入:
Host: ping.chartbeat.net
Host: extra.test.co
userblablabla
Host: extra.test.co
Host: extra.test.co
Host: extra.test.co
Host: extra.test.co
Host: extra.test.co
Host: extra.test.co
Host: extra.test.co
Host: extra.test.co
Host: secure.test.com
userlalalalala
Host: ping.chartbeat.net
Host: secure.test.com
Host: secure.test.com
Host: secure.test.com
我希望将其转换为:
Host: ping.chartbeat.net
Host: extra.test.co
userblablabla
Host: secure.test.com
userlalalalala
我该如何表现呢?
我尝试了|sort -u
,但这打破了我想要行的顺序