News for hackers. Stuff that matters.
Re:Removing duplicate lines from files keeping the original ... by asicsp on Wednesday May 29, 2019 @10:29AM (#20040580)
edit: this is failing if a line is repeated more than once, see @showdead's excellent explanation

the shortest I've got so far is

    perl -lnE'say if!++$#$_'
---

I don't understand what's happening with $#$_ but seems like something I should look into, thanks :)

you could remove n as p is used and would be same no. of characters as

    perl -ne 'print if $#$_++'
you could save one more by removing space between e switch and single quote

There are no comments on this comment yet.