|
|
|
|
|
by adimitrov
3436 days ago
|
|
The awk line for duplicate lines without changing ordering is… wow. Awk is such an underused tool (at least for me.) My solution was: awk '{printf "%2d %s\n", NR, $0}' < faces.txt | sort -k 2 -u | sort -n | sed 's/^...//'
Ironically, it also involved awk! But I used it to prepend line numbers, which uniq and sort can ignore, then re-sort it according to line numbers. Very much not an ideal solution! |
|
awk '!h[$0] {h[$0]=1; print}' faces.txt