Hacker News new | ask | show | jobs
by ianmcgowan 3436 days ago
Mine was more procedural - store each line in a hash as you visit it, and only print lines you haven't already visited. awk is awesome ;-)

awk '!h[$0] {h[$0]=1; print}' faces.txt

1 comments

I also used this approach but the original creator's version posted on GitHub is remarkably more concise (due to a clever use of the ++ operator).
awk '!h[$0]++' faces.txt

That is clever! Awk golf hole-in-one ;-)