3 ms·
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]=
by ianmcgowan 10y 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
- schoen 10y agoI 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).
- ianmcgowan 10y agoawk '!h[$0]++' faces.txt That is clever! Awk golf hole-in-one ;-)